如何去实现左侧固定宽度,右侧自适应宽度的两列布局?
这篇文章讲解的是利用flex布局来实现这个效果。
<div class="outer"> <div class="left">固定宽度</div> <div class="right">自适应宽度</div> </div>
.outer{ width: 100%; height: 500px; background-color: yellow; display: flex; flex-direction: row; } .left{ width: 200px; height: 200px; background-color: red; } .right{ height: 200px; background-color: blue; flex: 1; }