圣杯布局与双飞翼
圣杯布局
先写出基础格式
<header><h4>Header内容区</h4></header>
<div class="container">
<div class="middle"><h4>中间弹性区</h4></div>
<div class="left"><h4>左边栏</h4></div>
<div class="right"><h4>右边栏</h4></div>
</div>
<footer><h4>Footer内容区</h4></footer>
.header {
width: 100%;
height: 100px;
background-color: darkseagreen;
}
.footer {
width: 100%;
height: 30px;
background-color: darkslategray;
}
.container {
height: 200px;
padding: 0 100px 0 50px;
overflow: hidden;
background-color: rgb(242, 245, 241);
}
.left,
.middle,
.right {
position: relative;
float: left;
height: 100px;
}
.middle {
width: 100%;
background-color: rgb(161, 25, 43);
}
.left {
width: 50px;
background-color: rgb(68, 156, 28);
}
.right {
width: 100px;
background-color: rgb(25, 39, 161);
}让中间自适应的盒子安全显示
双飞翼布局
html 样式
css 样式
二者区别
最后更新于