写一个左中右布局占满屏幕,其中左右两块是苦丁宽200px,中间自适应宽,要求先加载中间块。

<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>

  

posted @ 2023-05-18 17:24  TM_cc  阅读(18)  评论(0)    收藏  举报