所谓的两栏布局指的是左边固定,右边自适应。
.father {
overflow: hidden;
}
.left {
width: 200px;
height: 200px;
float: left;
background-color: red;
}
.right {
margin-left: 210px;
height: 200px;
background-color: blue;
}
.father {
display: flex;
}
.left {
width: 200px;
height: 200px;
background-color: red;
}
.right {
flex: 1;
height: 200px;
background-color: blue;
}
.father {
overflow: hidden;
position: relative;
}
.left {
width: 200px;
height: 200px;
background-color: red;
}
.right {
position: absolute;
height: 200px;
left: 200px;
right: 0;
top: 0;
bottom: 0;
background-color: pink;
}
.father {
overflow: hidden;
}
.left {
float: left;
height: 200px;
width: 200px;
background-color: blue;
}
.right {
float: left;
width: calc(100% - 200px);
height: 200px;
background-color: pink;
}
所谓的双飞翼布局指的是左右固定,中间自适应。
.father {
overflow: hidden;
}
.left {
width: 200px;
height: 200px;
float: left;
background-color: red;
}
.right {
width: 200px;
height: 200px;
float: right;
background-color: aqua;
}
.mid {
height: 200px;
margin-right: 220px;
margin-left: 220px;
background-color: blue;
}
.father {
display: flex;
}
.left {
width: 200px;
height: 200px;
background-color: red;
}
.right {
width: 200px;
height: 200px;
background-color: blue;
}
.mid {
width: 100%;
margin: 0 20px;
background-color: aqua;
}
.father {
position: relative;
}
.left,
.right,
.mid {
height: 200px;
}
.left {
width: 200px;
position: absolute;
top: 0;
left: 0;
background-color: red;
}
.right {
width: 200px;
position: absolute;
top: 0;
right: 0;
background-color: blue;
}
.mid {
margin: 0 210px;
background-color: aqua;
}