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

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

时间:2023-05-18 17:33:30浏览次数:55  
标签:width 100% 左中右 height 苦丁 background 0px 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>

  

标签:width,100%,左中右,height,苦丁,background,0px,200px
From: https://www.cnblogs.com/tmccjs/p/17412605.html

相关文章