head、footer、三栏中间自适应,两边固定长度布局实现

本文最后更新于:2023年3月19日 晚上

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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<body style="margin:0">
<div
style="display: flex;flex-direction:column;width: 100vw;height: 100vh;"
>
<div
style="box-sizing: border-box;width: 100%;height: 100px;background-color: #F00;padding:10px"
></div>
<div
style="display: flex;flex-direction:flex;width: 100%;height: calc(100% - 200px);"
>
<div
style="width: 100px;background-color: #0F0;box-sizing: border-box;margin: 10px;"
></div>
<div
style="width: calc(100% - 200px);background-color: #00F;box-sizing: border-box;margin: 10px;"
></div>
<div
style="width: 100px;background-color: #F00;box-sizing: border-box;margin: 10px;"
></div>
</div>
<div
style="box-sizing: border-box;width: 100%;height: 100px;background-color: #F00;padding:10px"
></div>
</div>
</body>
</html>

本博客所有文章除特别声明外,均采用 CC BY-SA 4.0 协议 ,转载请注明出处!