三欄布局的方式

2021-10-20 04:13:07 字數 2790 閱讀 3875

攀登,到達乙個你們心中遙不可及的高度。

class

="layout float"

>

type

="text/css"

>

.layout .left

.layout .right

.layout .center

style

>

class

="left-right-center"

>

class

="left"

>

div>

class

="right"

>

div>

class

="center"

>

>

浮動解決方案h1

>

div>

article

>

class

="layout absolute"

>

type

="text/css"

>

.layout.absolute .left-center-right>div

.layout.absolute .left

.layout.absolute .center

.layout.absolute .right

style

>

class

="left-center-right"

>

class

="left"

>

div>

class

="center"

>

>

絕對定位解決方案h1

>

div>

class

="right"

>

div>

article

>

section

>

class

="layout flex"

>

type

="text/css"

>

.layout.flex

.layout.flex .left-center-right

.layout.flex .left

.layout.flex .center

.layout.flex .right

style

>

class

="left-center-right"

>

class

="left"

>

div>

class

="center"

>

>

彈性盒子解決方案h1

>

div>

class

="right"

>

div>

article

>

section

>

父元素轉為display:table後,子元素無法設定最小高度,所以我們需要給父元素加上乙個高度

class

="layout table"

>

type

="text/css"

>

.layout.table .left-center-right

.layout.table .left-center-right>div

.layout.table .left

.layout.table .center

.layout.table .right

style

>

class

="left-center-right"

>

class

="left"

>

div>

class

="center"

>

>

table解決方案h1

>

div>

class

="right"

>

div>

article

>

section

>

class

="layout grid"

>

type

="text/css"

>

.layout.grid .left-center-right

.left

.center

.right

style

>

class

="left-center-right"

>

class

="left"

>

div>

class

="center"

>

>

grid網格布局解決方案h1

>

div>

class

="right"

>

div>

article

>

section

>

三欄布局的實現方式

1.使用浮動float實現 cotainer left right center 2.使用position,父級div設定position relative,三個子級div設定position absolute,這個要計算好盒子的寬度和間隔去設定位置,相容性比較好 container left ce...

三欄布局的幾種方式

這裡介紹幾種三欄布局的實現方式,最終目的都是左右兩邊固定寬度,中間的自適應。最終效果如下 一 流式布局 en class wrap class left class right class main 優點 這是比較正常的思路,兩邊浮動,中間利用margin。缺點 主題部分不能優先載入,體驗不好。2 ...

常見的布局(兩欄 三欄布局)

常見布局 兩欄布局 左邊寬度固定200px,右邊自適應 1 左邊float left 右邊margin left 左邊盒子的寬度 container left right style class cantainer class left div class right div div 2 左邊flo...