利用flex实现两边固定,中间随着浏览器宽度变化而变化的布局。 

圣杯布局(双飞翼)

代码部分

css部分

            .box{display:flex;}
            .box1{
                width: 200px;
                height: 500px;
                background: red;
            }
            .box2{
                height: 530px;
                background: orange;
                flex:1;
            }
            .box3{
                width: 200px;
                height: 500px;
                background: red;
            }

body部分

<!--圣杯布局-->
        <div class="box">
            <div class="box1">左</div>
            <div class="box2">中</div>
            <div class="box3">右</div>
        </div>
        

相关文章:

  • 2021-07-13
  • 2021-08-23
  • 2021-06-17
  • 2021-07-06
猜你喜欢
  • 2021-12-10
  • 2021-11-01
  • 2021-07-30
  • 2021-11-27
  • 2021-09-22
相关资源
相似解决方案