# 基本概念



# 上中下布局 中间自适应
<style>
*{
margin:0;
padding:0;
box-sizing:border-box;
}
ul{list-style:none;}
.container{
height:100vh;
display:flex;
flex-direction: column;
}
header{
min-height:50px;
background:#ddd;
}
main {
flex-grow:1;
overflow:auto;
}
footer > ul {
height:50px;
display: flex;
}
footer > ul > li {
background:red;
width:25%;
height:100%;
border:1px solid black;
}
</style>
</head>
<body>
<div class="container">
<header>header</header>
<main>
<p>main</p>
省略
<p>main</p>
</main>
<footer>
<ul>
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
</footer>
</div>
</body>
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
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

# 产品列表布局
<style>
*{margin:0;padding:0;box-sizing:border-box;}
ul{list-style:none;}
ul{
display:flex;
flex-wrap:wrap;
width:350px;
margin:auto;
border:1px solid black;
justify-content:space-between;
}
li {
width:100px;
height:100px;
background:#ddd;
border:1px solid red;
}
</style>
</head>
<body>
<ul>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
</body>
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
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

# 双飞翼布局
<style>
header{
height:50px;background:#ddd;
}
footer{
height:50px;background:#ddd;
}
.content{
display:flex;
}
.content > aside {
width:120px;
background: #444;
}
.content main {
height:400px;
flex-grow:1;
background:red;
}
.content > nav {
width:100px;
background:green;
}
</style>
</head>
<body>
<header></header>
<div class="content">
<aside></aside>
<main></main>
<nav></nav>
</div>
<footer></footer>
</body>
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
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
