-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
59 lines (50 loc) · 1.09 KB
/
index.html
File metadata and controls
59 lines (50 loc) · 1.09 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>折叠屏适配示例</title>
<style>
body {
margin: 0;
padding: 0;
}
.container {
display: flex;
flex-direction: column;
align-items: center;
padding: 20px;
}
h1 {
font-size: 24px;
}
p {
font-size: 16px;
}
/* 普通屏幕尺寸 */
@media (min-width: 320px) and (max-width: 767px) {
.container {
background-color: lightblue;
}
}
/* 折叠屏展开状态或较大平板尺寸 */
@media (min-width: 768px) and (max-width: 1023px) {
.container {
background-color: lightgreen;
}
}
/* 更大尺寸的桌面显示器等 */
@media (min-width: 1024px) {
.container {
background-color: lightcoral;
}
}
</style>
</head>
<body>
<div class="container">
<h1>欢迎来到我的网页</h1>
<p>这个网页可以自适应不同设备尺寸,包括折叠屏。</p>
</div>
</body>
</html>