HTML5+CSS3-基础11-双飞翼布局
双飞翼布局(左固定右固定,中间自适应)
<!DOCTYPE html>
<html lang="en">
<head>
<title></title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="css/style.css" rel="stylesheet">
<style>
.box {
width: 1000px;
height: 500px;
background-color: skyblue;
}
.container {
width: 100%;
background-color: green;
height: 200px;
}
.container .center {
height: 400px;
margin: 0 200px;
background-color: red;
}
.left,
.right {
width: 200px;
height: 300px;
}
.left,
.container,
.right {
float: left;
}
.left {
background-color: pink;
margin-left: -100%;
}
.right {
background-color: yellow;
margin-left: -200px;
}
</style>
</head>
<body>
<div class="box">
<div class="container">
<div class="center"></div>
</div>
<div class="left"></div>
<div class="right"></div>
</div>
</body>
</html>
内容仅供学习参考,若有错误欢迎大家指正----WUCASE