2012-04-29 3 views
0

Je crée divs dans le heirachy suivantcréé Dynamiquement numéro div poistioning

<div class="box"> 
Content goes here 
<div class="footer>Footer</div> 
</div> 
<div class="box"> 
Content goes here 
<div class="footer>Footer</div> 
</div> 
<div class="box"> 
Content goes here 
<div class="footer>Footer</div> 
</div> 

La boîte principale "boîte" est scrollable. Je veux que le pied de page "bas de page" reste en bas du conteneur parent, e "box". Je google pendant trois jours. Aucun n'a travaillé. Très anxieux. S'il vous plaît aider

+1

Vous voulez dire que vous voulez persister au fond de la boîte quel que soit le défilement? S'il vous plaît partagez votre code CSS. –

Répondre

1

vous devez utiliser la position absolue et le fond 0 comme Sarfraz ci-dessus.

est exemple de code ici:

<html> 
<head> 
<style> 
body { width:100%;} 
.box { float: left; height: 200px; margin-right: 5%; position: relative; width: 20%;} 
.footer {bottom: 0px; position: absolute; width: 100%; text-align: center;} 
.box_content{ height: 180px; overflow-y: scroll;} 
.clear { clear:both;} 
</style> 
</head> 
<body> 
<div class="box"> 
    <div class="box_content"> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
    </div> 
    <div class="footer">Footer</div> 
</div> 
<div class="box"> 
    <div class="box_content"> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
    </div> 
    <div class="footer">Footer</div> 
</div> 
<div class="box"> 
    <div class="box_content"> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
     Content goes here <br /> 
    </div> 
    <div class="footer">Footer</div> 
</div> 
<div class="clear"> </div> 
</body> 
</html> 
Questions connexes