<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<link rel="stylesheet" href="">
<style type="text/css" media="screen">
*{
margin: 0px;
padding:0px;
}
.wrap{
width:400px;
height:400px;
border:1px solid black;
margin:0 auto;
display: flex;
resize:both;/*注意:resize适用于:所有 <' overflow '> 设置为非visible的元素*/
overflow: hidden;
flex-direction: column;
}
.head,
.footer,
.left,
.right
{
flex:0 0 20%;
border:1px solid black;
box-sizing: border-box;
}
.contain{
flex:1 1 auto;
display: flex;
}
.center{
flex:1 1 auto;
}
</style>
</head>
<body>
<div class="wrap">
<div class="head">head</div>
<div class="contain">
<div class="left">left</div>
<div class="center">center</div>
<div class="right">right</div>
</div>
<div class="footer">footer</div>
</div>
</body>
</html>
用弹性盒子实现圣杯布局
最新推荐文章于 2024-07-21 21:06:06 发布