最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
css 容器高度100%及相对高宽
时间:2022-07-02 12:24:30 编辑:袖梨 来源:一聚教程网
* { margin:0; padding:0; border:0;}
html,body { height:100%;}
#box_2 { height:100%; background:#000;}
绝对定位重叠效果
#box_1 { position:absolute; top:0; left:0; width:100%; background:#f00; z-index:2;}
#box_2 { position:absolute; left:0; top:0; width:100%; height:100%; background:#000; z-index:1;}
纵向高度相对大小效果
#box_1 { position:absolute; top:0; left:0; width:100%; height:30%; background:#f00; z-index:2;}
#box_2 { position:absolute; left:0; top:30%; width:100%; height:70%; background:#000; z-index:1;}
横向宽度相对大小效果
#box_1 { position:absolute; top:0; left:0; width:30%; height:100%; background:#f00; z-index:2;}
#box_2 { position:absolute; top:0; right:0; width:70%; height:100%; background:#000; z-index:1;}
实际应用中,可有很多变化,轻松实现没有嵌套的绝对或相对多列竖排、横排。
IE6.0和FF1.5测试通过
相关文章
- Ethverse(ETHV币)在交易所的排名 07-01
- 专家解析XRP价格为何持续低迷,预测下一轮上涨时间节点 07-01
- 二重螺旋协同伙伴技能详解 菲娜塔比瑟琳恩实战解析 07-01
- 胜利女神牡丹技能详解 黑帮大姐大战斗表现怎么样 07-01
- 最终幻想14手游收费模式介绍 FF14手游要付费吗 07-01
- 三角洲行动S5赛季M4A1最新无后座改枪码 07-01