圣杯布局
<!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>
<script src="./index.js"></script>
<style>
.container{
padding-left: 200px;
padding-right: 150px;
}
.left{
position: relative;
background-color: yellow;
width: 200px;
margin-left: -100%;
right: 200px;
}
.right{
background-color: red;
width: 150px;
margin-right: -150px;
}
.center{
background-color: chocolate;
width: 100%;
}
.col{
float: left;
height: 100px;
}
.clearfix:after{
clear: both;
display: table;
content:'';
}
</style>
</head>
<body>
<div class="container clearfix">
<div class="center col"></div>
<div class="left col"></div>
<div class="right col"></div>
</div>
</body>
</html>
双飞翼布局
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>双飞翼布局</title>
<style type="text/css">
body {
min-width: 550px;
}
.col {
float: left;
}
#main {
width: 100%;
height: 200px;
background-color: #ccc;
}
#main-wrap {
margin: 0 190px 0 190px;
}
#left {
width: 190px;
height: 200px;
background-color: #0000FF;
margin-left: -100%;
}
#right {
width: 190px;
height: 200px;
background-color: #FF0000;
margin-left: -190px;
}
</style>
</head>
<body>
<div id="main" class="col">
<div id="main-wrap">
this is main
</div>
</div>
<div id="left" class="col">
this is left
</div>
<div id="right" class="col">
this is right
</div>
</body>
</html>