1 <html> 2 <head> 3 <style> 4 5 .big{ 6 width:20%; 7 height:100%; 8 float:left; 9 position:relative; 10 } 11 12 .small{ 13 width:100%; 14 position:absolute; 15 bottom:0; 16 } 17 </style> 18 </head> 19 <body> 20 <div class="big"> 21 <div class="small">我在底部</div> 22 </div> 23 </body> 24 </html>
如果要始终固定在页面底部,那么就需要使用:position:fixed