首页 > 代码库 > border-box实现自适应分栏布局

border-box实现自适应分栏布局

最近看些老东西,发觉ie下的盒模型用处还是挺大的
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
body{
padding: 0;
margin: 0;
}
.panel-list{
width: 100%;
}
.panel{
float: left;
width: 25%;
height: 200px;
background: #f00;
border: 2rem solid #fff;
box-sizing: border-box;
}
</style>
</head>
<body>
<div class="panel-list">
<div class="panel">

</div>
<div class="panel">

</div>
<div class="panel">

</div>
<div class="panel">

</div>

</div>
</body>
</html>

border-box实现自适应分栏布局