将body元素这样设置:
display:flex;flex-direction:column;
它有两个子元素:
<p style="height:200px;"></p>
<p style="flex:auto" id="flex"></p>
这样一来,flex元素可以自适应高度。它里面还有两个子元素:
<p style="position:absolute;right:0;width:100px;"></p>
<p style="width:100px;"></p>
如果flex元素的高度为800像素,怎么让这两个元素的高度充满flex元素?
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
把flex设置成弹性盒子,竖直,这样就可以了