-
Notifications
You must be signed in to change notification settings - Fork 118
/
flexDemo.html
54 lines (47 loc) · 1.17 KB
/
flexDemo.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
<!DOCTYPE html>
<html>
<head>
<!--
本代码来自:http://www.ruanyifeng.com/blog/2015/07/flex-examples.html
注意Flex并不支持IE10以下的IE浏览器,详细支持浏览器列表:http://caniuse.com/#search=flex
-->
<meta charset="utf-8">
<title>Flex--圣杯布局</title>
<style type="text/css">
.HolyGrail {
display: flex;
min-height: 100vh;
flex-direction: column;
}
.header,
.footer {
flex: 1;
background: #abb;
}
.HolyGrail-body {
display: flex;
/* 3表示所占的份数,本例总共分为5份 */
flex: 3;
}
.HolyGrail-content {
flex: 1;
background: #acdaaa;
}
.HolyGrail-nav,
.HolyGrail-ads {
/* 两个边栏的宽度设为12em */
flex: 0 0 12em;
background: #faaccc;
}
</style>
</head>
<body class="HolyGrail">
<div class="header"></div>
<div class="HolyGrail-body">
<div class="HolyGrail-nav"></div>
<div class="HolyGrail-content"></div>
<div class="HolyGrail-ads"></div>
</div>
<div class="footer"></div>
</body>
</html>