实现一个div,左边固定div宽度200px,右边div自适应
<div class= "container">
<div class="left"></div>
<div class="right"></div>
</div>
<style>
.container{
width:1000px;height:400px;border: 1px solid red;
}
.left{
width:200px;height:100%;background: gray;
float: left;
}
.right{
overflow:hidden;
background: green;
}
.container{
width:1000px;height:400px;border:1px solid red;
display:flex;
}
.left{
width:200px; height:100%;background:gray;
flex:none;
}
.right{
height:100%;background:green;
flex:1;
}
.container{
width:1000px;height:400px;border:1px solid red;
display:table;
}
.left{
width:200px; height:100%;background:gray;
display:table-cell;
}
.right{
height:100%;background:green;
display: table-cell;
}
.container{
width:1000px;height:400px;border:1px solid red;
}
.left{
width:200px;height:100%;background:gray;
float:left;
}
.right{
height:100%;background:green;
float:right;
width:calc(100% - 200px);
}
</style>