方法一
****弹性盒子模型
<style>
.content{
height: 500px;
width:100%;
display: flex;
}
.left{
width:150px;
height:500px;
background: red;
}
.right{
height:500px;
width:150px;
background: rgb(40, 185, 113);
}
.center{
flex:1;
background: rgb(35, 11, 138);
}
</style>
<div class="content">
<div class="left"></div>
<div class="center"></div>
<div class="right"></div class="right">
</div>
方法二 浮动
<style>
html,body{
padding: 0;
margin: 0;
}
/* 浮动布局 */
.left,.right{
width: 300px;
height: 200px;
background-color:
}
.left{
float: left;
}
.right{
float: right;
}
.center{
height: 200px;
background-color:
}
</style>
<div class="content">
<div class="left"></div>
<div class="center"></div>
<div class="right"></div class="right">
</div>