【css面试题】实现2栏布局 右侧自适应; 3栏布局 中间自适应

2栏布局 右侧自适应

flex

grid

table

float

 <style >
    body{
      
      
        height: 400px;
    }
    .son1{
      
      
        width: 20%;
        height: 100%;
        float: left;
    }
    .son2{
      
      
        margin-left: 20%;
        height: 100%;
        
    }
   
  </style>
<body>        
    <div class="son1" style="background-color: #d2e085;"> A </div>
    <div class="son2" style="background-color: #7cdbe4;"> B </div>

</body>

absolute

3栏布局 中间自适应

猜你喜欢

转载自blog.csdn.net/weixin_63681863/article/details/132753704