两边固定中间自适应
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
*{
margin: 0;
padding: 0;
}
.outer{
min-width: 1000px;
overflow: hidden;
}
.main{
width: 100%;
height: 500px;
background-color: yellowgreen;
float: left;
}
.left{
width: 200px;
height: 500px;
background-color: yellow;
float: left;
margin-left: -100%;
}
.right{
width: 200px;
height: 500px;
background-color: orange;
float: left;
margin-left: -200px;
}
.inner{
padding: 0 200px;
}
</style>
</head>
<body>
<div class="outer">
<div class="main">
<div class="inner">中间</div>
</div>
<div class="left">左边</div>
<div class="right">右边</div>
</div>
</body>
</html>