<html lang="en"> <body> <div class="container"> <div class="main "> 中间 </div> <div class="left"> 左边 </div> <div class="right"> 右边 </div> </div> </body> </html>
<style> body{ margin:0; padding:0; } .container{ width:100vw; height:100vh; } .main{ padding: 0px 200px; box-sizing: border-box; background:red; height:100%; } .left{ width:200px; background:skyblue; position:absolute; left:0px; top:0; height:100%; } .right{ width:200px; background:yellow;; position:absolute; right:0px; top:0; height:100%; } </style>
标签:width,100%,左中右,height,苦丁,background,0px,200px From: https://www.cnblogs.com/tmccjs/p/17412605.html