一.常见两列布局(左栏固定宽度,右栏自适应)
1.左边设置固定宽度并浮动,右边自适应
#container{
width: 100%;
min-width:450px;
height: 1000px;
}
.left{
float: left;
width: 200px;
height: 100%;
background: rgba(167, 158, 158,.4);
}
.right{
float:right;
width:calc(100% - 200px);
min-width:250px;
height: 100%;
background: yellowgreen;
}
2.flex布局
#container{
width: 100%;
min-width:450px;
height: 1000px;
display: flex;
}
#container>*{
height:100%;
}
.left{
width: 200px;
background: rgba(167, 158, 158,.4);
}
.right{
flex: 1;
min-width:250px;
background: yellowgreen;
}
回顾:2022-12-29 [整理]flex弹性布局
二.常见三列布局(左右固定宽度,中间自适应)
1.两边左右浮动
#container