行内块+calc+margin 三列布局

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
.main{font-size:0;} /* 去掉行内块受换行符的影响*/
.left{display:inline-block;width:200px;height:500px;background-color:red}
.middle{display:inline-block;width: calc(100% - 420px);height:500px;background-color:#000;margin:0 10px;}
.right{display:inline-block;width:200px;height:500px;background-color:red}
</style>
</head>
<body>

<div class="main">
<div class="left"></div>
<div class="middle"></div>
<div class="right"></div>
</div>

</body>
</html>
posted @ 2018-08-28 16:26  —只小白  阅读(728)  评论(0编辑  收藏  举报