首页 > Web开发 > 详细

【html】【8】div布局[子div在父div居底]

时间:2015-12-09 11:24:41      阅读:247      评论:0      收藏:0      [点我收藏+]
从今天起 开始细话div布局
 
思路及要点:
父div的位置设置成相对的,即“position: relative;”。
而子div的位置设置成绝对的,并且下边缘设为0,即“position: absolute; bottom: 0;”。
 
代码
 1 <head>
 2     <title>子div在父div中置底</title>
 3     <style type="text/css">
 4         .father { width: 500px; height: 600px; position: relative; background-color: AliceBlue; }
 5         .child { width: 400px; height: 100px; position: absolute; bottom: 0; background-color: AntiqueWhite; }
 6     </style>
 7 </head>
 8 <body>
 9     <div class="father">
10         <div class="child">
11         </div>
12     </div>
13 </body>
14 </html>

大致效果

技术分享

 

ok  学习要坚持  不要贪多~~~

 

 

【html】【8】div布局[子div在父div居底]

原文:http://www.cnblogs.com/aiqingqing/p/5032091.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!