三栏布局
来源:3-7 布局-解题-3

慕粉1470117225
2020-07-29
<!DOCTYPE html>
<html lang="en">
<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>Document</title>
<style>
.container {
width: 800px;
height: 200px;
}
.left {
background: red;
width: 200px;
position: absolute;
height: 200px;
}
.right {
background: blue;
float: right;
width: 200px;
height: 100%;
}
.middle {
margin-left: 200px;
margin-right: 200px;
}
</style>
</head>
<body>
<div class="container">
<div class="left">
左
</div>
<div class="right">
右
</div>
<div class="middle">
中间
</div>
</div>
</body>
</html>
老师,这样就很简单的实现了三栏布局,通过中间的div设置左右的margin就行了,比圣杯布局好理解多了啊。难道是因为中间的div放在了最上面,比较快显示出来?
写回答
1回答
-
双越
2020-07-29
是的,中间内容最重要,要最先显示出来。
00
相似问题