<!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;
}
.content{
overflow: hidden;
}
.center,.left,.right{
float: left;
height: 100px;
}
.center{
width: 100%;
background-color: pink;
}
.main{
margin-left: 300px;
margin-right: 200px;
height: 100px;
background-color: red;
}
.left{
background-color: skyblue;
width: 300px;
margin-left: -100%;
}
.right{
background-color: greenyellow;
width: 200px;
margin-left: -200px;
}
header,footer{
background-color: oldlace;
height: 100px;
}
</style>
</head>
<body>
<header>头部</header>
<div class="content">
<div class="center">
<div class="main">主区域</div>
</div>
<div class="left">左区域</div>
<div class="right">右区域</div>
</div>
<footer>底部</footer>
</body>
</html>
CSS 双飞翼布局
最新推荐文章于 2024-04-07 21:56:11 发布