0
点赞
收藏
分享

微信扫一扫

两列布局

彭维盛 2022-08-19 阅读 91


flex如果没有规定就取默认 内容宽度排成一行
如果规定flex:n(份数);
会自动计算减去其他元素的固定宽度

<div style="display: flex;">
<div style="width: 100px;background-color: aqua;height: 300px;">

</div>
<div style="flex: 1;background-color: red;height: 100vh;word-break: break-all;">

</div>
</div>

<div style="width: 100px;background-color: aqua;height: 300px;position: absolute;">

</div>
<div style="width: calc(100vw - 100);margin-left: 100px;background-color: red;height: 100vh;word-break: break-all;">

</div>


举报

相关推荐

0 条评论