Stacking Divs from Bottom to Top

前端 未结 7 2178
北荒
北荒 2020-12-04 09:46

When appending divs to a div with a fixed height, the child divs will appear from top to bottom, sticking at the top border.

┌─────         


        
相关标签:
7条回答
  • 2020-12-04 10:44
    <div style="height: 500px;">
        <div style="height: 20px; position: absolute; bottom: 120px;">Child Div 1</div>
        <div style="height: 20px; position: absolute; bottom: 100px;">Child Div 2</div>
        <div style="height: 20px; position: absolute; bottom: 80px;">Child Div 3</div>
        <div style="height: 20px; position: absolute; bottom: 60px;">Child Div 4</div>
        <div style="height: 20px; position: absolute; bottom: 40px;">Child Div 5</div>
    </div>
    
    0 讨论(0)
提交回复
热议问题