css实现flex多列布局

三列 左中定宽 右侧自适应

.container{
        display: flex;
        height: 300px;
    }
    .left{
        flex: 0 0 100px;
        background-color: red;
    }
    .middle{
        flex: 0 0 100px;
        background-color: green;
    }
    .right{
        flex:1;
        background-color: blue;
    }
  
    qqq
    qqq
    wwww

css实现flex多列布局

缩小浏览器窗口后

css实现flex多列布局

左右固定,中间自适应

  .container{
        display: flex;
        height: 300px;
    }
    .left{
        width: 100px;
        background-color: red;
    }
    .middle{
        flex: 1;
        background-color: green;
    }
    .right{
       width: 100px;
        background-color: blue;
    }
   
    qqq
    qqq
    wwww

css实现flex多列布局

缩小浏览器窗口后

css实现flex多列布局

九宫格布局

.container{
        display: flex;
        height: 300px;
        width: 300px;
        flex-direction: column;
    }
    .row{
        display: flex;
        height: 100px;
    }
    .left{
        flex: 1;
        height: 100px;
        border: 1px solid red;
    }
    .middle{
        flex: 1;
        height: 100px;
        border: 1px solid green;
    }
    .right{
        flex: 1;
        height: 100px;
        border: 1px solid blue;
    }
    
    
        
        
        
    
    
        
        
        
    
    
        
        
        
    

css实现flex多列布局

圣杯布局

  *{
        margin:0;
        padding:0;
    }
    .container{
        display: flex;
        flex-direction: column;
        min-height: 100vh;
        justify-content: space-between;
    }
    .header{
        background: red;
        flex: 0 0 100px;
    }
    .content{
        display: flex;
        flex:1;
    }
    .content-left{
        flex: 0 0 100px;
        background: green;
    }
    .content-right{
        flex: 0 0 100px;
        background: pink;
    }
    .content-middle{
        flex:1;
    }
    .footer{
        background: yellow;
        flex: 0 0 100px;
    }
    
    Header
    
        Left
        Center
        Right
    
    Footer

css实现flex多列布局

缩小浏览器窗口之后

css实现flex多列布局

看完上述内容,你们对css实现flex多列布局有进一步的了解吗?如果还想了解更多知识或者相关内容,请关注创新互联行业资讯频道,感谢大家的支持。


当前名称:css实现flex多列布局
URL分享:http://tjjierui.cn/article/jcgdgs.html

其他资讯

在线咨询
服务热线
服务热线:028-86922220
TOP