用弹性布局flex:
给父盒子加个display:flex; 给中间盒子设flex=1;
/* 弹性盒子布局*/
.wrap{
width: 100%;
height: 90px;
display: flex;
}
.left{
width: 300px;
height: 90px;
background-color: red;
float: left;
}
.content{
flex:1;
height: 90px;
background-color: yellow;
}
.right{
width: 300px;
height: 90px;
background-color:blue;
float: right;
}
</style>
</head>
<body>
<div class="wrap">
<div class="left"></div>
<div class="content"></div>
<div class="right"></div>
</div>