使用弹性布局实现两个div其中一个固定宽度,另一个填充满窗口
.div-box {
display: flex;
height: 100px;
line-height: 100px;
background: pink;
text-align: center;
}
.div1 {
width: 100px;
height: 100%;
background: yellow;
}
.div2 {
flex: 1;
background: green;
height: 100%;
}
<div class="div-box">
<div class="div1">DIV1</div>
<div class="div2">DIV2</div>
</div>