利用較新的 Flexbox API 和 HTML 在全高應用中實現 Flexbox 和垂直滾動


flex 屬性是 flex-grow、flex-shrink 和 flex-basis 屬性的簡寫。flex 屬性在可變項上設定可變長度。

例如 -

#container article {
   -webkit-flex: 1 1 auto;
   overflow-y: auto;
   height: 0px; /*here the height is set to 0px*/
}

如果您想設定最小高度,可以使用 height: 100px;,它與 min-height: 100px; 完全相同;

#container article {
   -webkit-flex: 1 1 auto;
   overflow-y: auto;
   height: 100px; /*here the height is set to 100px*/
}

更新於: 2020-06-24

488 次瀏覽

開啟你的職業生涯

透過完成課程獲得認證

開始
廣告
© . All rights reserved.