-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwing-layout.html
64 lines (54 loc) · 1.32 KB
/
wing-layout.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<!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>
<link rel="stylesheet" href="./bg-color.css">
<style>
.container {
display: flow-root;
min-width: 550px;
}
.wrap-center,
.left,
.right {
float: left;
}
.wrap-center {
width: 100%;
}
.center {
margin-left: 200px;
margin-right: 150px;
}
.left {
width: 200px;
margin-left: -100%;
}
.right {
width: 150px;
margin-left: -150px;
}
</style>
</head>
<body>
<!--
1. 首先设置三栏浮动(中栏包裹层浮动),父容器清除浮动
2. 设置三栏的宽度,中栏包裹层自适应,左右两栏定宽
3. 中栏设置 margin,给左右两栏预留出空间
4. 左右两栏使用负外边距,浮动到中栏预留出的空间
5. 给父容器设置最小宽度(左栏+右栏),防止布局坏掉
-->
<div class="header">header</div>
<div class="container">
<div class="wrap-center">
<div class="center">center</div>
</div>
<div class="left">left</div>
<div class="right">right</div>
</div>
<div class="footer">footer</div>
</body>
</html>