三栏布局,中间自适应,左右固定实现方法

方法一:浮动

hello


.left{ 【三栏布局,中间自适应,左右固定实现方法】float:left;
width: 200px;
height: 300px;
background: red;
}
.right{
float: right;
width: 200px;
height: 300px;
background: green;
}
.content{
width: 100%;
height: 300px;
background: blue;
}
方法二:定位 .left{
width: 200px;
height: 300px;
background: red;
position: absolute;
left: 0;
top: 0;
}
.right{
width: 200px;
height: 300px;
background: green;
position: absolute;
right: 0;
top: 0;
}
.content{
width: 100%;
height: 300px;
background: blue; margin:0 200px;
} .container{ position:relative; }
方法三:display:box .left{ width: 200px;
height: 300px;
background: red;
}
.right{ width:200px;
height: 300px;
background: green;
}
.content{
box-flex:1
height: 300px;
background: blue;
} .container{ display:box; } 转载于:https://www.cnblogs.com/yaliu/p/5191897.html

    推荐阅读