<!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>圣杯布局</title>
</head>
<body>
<div class="container">
<div class="center"></div>
<div class="left"></div>
<div class="right"></div>
</div>
</body>
</html>
<style>
.container {
box-sizing: border-box;
width: 100%;
padding: 0 200px;
}
.container .center {
float: left;
width: 100%;
height: 400px;
background-color: chocolate;
border: black 2px solid;
box-sizing: border-box;
}
.container .left {
float: left;
width: 200px;
height: 400px;
margin-left: -100%;
position: relative;
right: 200px;
background-color: cadetblue;
}
.container .right {
float: left;
width: 200px;
height: 400px;
margin-left: -200px;
position: relative;
left: 200px;
background-color: brown;
}
</style>
圣杯布局
最新推荐文章于 2023-04-20 15:16:51 发布