loading ...
loading...

2008-01-09 | DIV相对于父DIV底部对齐的实现方法

分享
标签: solid  style  cccccc  height  f2 

一般代码-未底部对齐:

<style type="text/css">
.box1 {border:1px #cccccc solid;  width:500px; height:600px;}
.box2 {border-top:1px #cccccc solid; border-bottom:0; background:#f2f6fb; width:500px; height:22px;}
</style>
<div class="box1">
    <div class="box2"></div>
</div>

底部对齐的代码:

<style type="text/css">
.box1 {border:1px #cccccc solid;  width:500px; height:600px;position:relative;}
.box2 {border-top:1px #cccccc solid; background:#f2f6fb; width:498px; height:22px; position:absolute; bottom:0;}
</style>
<div class="box1">
    <div class="box2"></div>
</div>

分享 分享 |  评论 (0) |  阅读 (?)  |  固定链接 |  类别 (CSS DIV) |  发表于 09:31
搜狐博客温馨提示:搜狐博客官方不会要求参加活动的各位博友缴纳任何的手续费用。请勿轻信留言、评论中的中奖信息,更不要拨打陌生电话及向陌生帐户汇款,谨防受骗!识别更多网络骗术,请 点击查看详情
您还未登录,只能匿名发表评论。或者您可以 登录 后发表。
 
  *中国人爱国心,搜狗输入法爱国主题皮肤下载>>
表  情:
加载中...
回复通知: 同时用小纸条通知对方该回复