html - Push divs down in containing div with CSS -
i build sort of "stack" of divs (with class .inner) within containing div (#container) each inner pushed far down in container possible without overlapping inner. i've included illustrations of 1 , 3 inners, respectively:
i know result on left setting...
#container { position: relative; } .inner { position: absolute; bottom: 0; }
...but solution not scale example on right - instead cause of inners overlap 1 another. there way accomplish want through css alone arbitrary number of inners? know hacky javascript.
you use additional container inner containers , use trick suggested.
<style> div{border:1px solid red} #container{height:1000px;} #inner-container{position:absolute;bottom:0px;} .inner {height:200px;width:200px;margin:5px;; </style> <div id="container"> <div id="inner-container"> <div class="inner"></div> <div class="inner"></div> <div class="inner"></div> </div> </div>
Comments
Post a Comment