css之div未知高度,剩余div铺满整个屏幕
<div id="content"> <div class="title"> title1 </div> <div class="title"> title2 </div> <div class="title"> title3 </div> <div id="article"></div> </div>
当我们不知道class为title的div中内容有多高的时候,但是需要让article铺满剩余屏幕的时候,需要将content变为弹性盒,具体代码如下
.content{ display: flex; flex-direction:column; } #article{ flex: 1 }
这样就可以了
相关推荐
qiupu 2020-11-04
多读书读好书 2020-11-03
RedCode 2020-10-28
jiedinghui 2020-10-25
Ladyseven 2020-10-22
hellowzm 2020-10-12
zuncle 2020-09-28
Ladyseven 2020-09-11
jiedinghui 2020-09-07
xiaohuli 2020-09-02
葉無聞 2020-09-01
impress 2020-08-26
ThikHome 2020-08-24
nicepainkiller 2020-08-20
hellowzm 2020-08-18