height: 100px;
background-color:pink;
overflow: hidden;
float: right;
}
2.利用table实现
.parent {
width: 100%;
height: 100px;
background-color: #007AFF;
display: table;
table-layout: fixed;
}
.left {
width: 10%; //百分比
height: 100px;
background-color: #2AC845;
display: table-cell;
}
.right {
height: 100px;
background-color:pink;
display: table-cell;
}
3.利用flex实现
.parent {
width: 100%;
height: 100px;
background-color: #007AFF;
display: flex;
}
.left {
height: 100px;
background-color: #2AC845;
}
.right {
flex: 1;
height: 100px;
background-color:pink;
}
多列等分布局
多列等分布局常出现在内容中,多数为功能的,同阶级内容的并排显示等。
HTML :
1
1
1
1
1.float 实现
.pa