摘抄與理解--css display:flex

一種布局方式,彈性布局,六個屬性

flex-direction:

flex-direction:row; 從左向右


flex-direction:column; 從上到下


flex-direction:row-reverse;從右到左

flex-wrap:

flex-wrap: nowrap;不換行


flex-wrap: wrap;順序換行


flex-wrap: wrap-reverse;倒著換行(算你狠)

justify-content:

justify-content : center;元素居中排列


justify-content : flex-start;元素從左開始排列


justify-content : flex-end;元素從右開始排列


justify-content : space-between;元素間間隔,兩端會靠邊


justify-content : space-around;類似與元素間左右padding

align-items:

align-items : flex-start;元素縱向,向上最齊


align-items : flex-end;元素縱向,向下最齊


align-items : center;元素縱向,居中最齊


align-items : baseline;元素一條線對齊


align-items: stretch;元素上下填滿

align-content:

align-content: flex-start;元素內(nèi)容縱向,從上到下


align-content: flex-end,元素內(nèi)容縱向,從下到上


align-content: stretch,垂直方向居中


align-content: center;元素被拉伸以占滿容器


align-content: space-between;平均分布,中間留空白


align-content: space-around;類似于上下padding

參考鏈接1:http://www.itdecent.cn/p/d9373a86b748/

參考鏈接2:https://developer.mozilla.org/en-US/docs/Web/CSS/align-content

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容