-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathiPhoneX6.html
135 lines (126 loc) · 3.05 KB
/
iPhoneX6.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover">
<title></title>
<style media="screen">
* {
margin: 0;
padding: 0;
}
body {
width: 100%;
height: 100%;
background-color: #A4F4B0;
}
header {
padding-left: constant(safe-area-inset-left);
/*padding-right: constant(safe-area-inset-left);*/
/*padding: constant(safe-area-inset-top) constant(safe-area-inset-right) 0 constant(safe-area-inset-left);*/
background-color: red;
height: 50px;
line-height: 50px;
width: 100%;
color: white;
position: fixed;
top: 0px;
left: 0px;
right: 0px;
padding-top: constant(safe-area-inset-top);
}
footer {
background-color: red;
height: 50px;
line-height: 50px;
width: 100%;
color: white;
position: fixed;
left: 0;
right: 0;
bottom: 0;
bottom: 0px;
padding-left: constant(safe-area-inset-left);
/*padding-right: constant(safe-area-inset-right);*/
padding-bottom: constant(safe-area-inset-bottom);
}
button {
display: inline-block;
background-color: blue;
color: white;
border: none;
height: 50px;
width: 80px;
font-size: 18px;
}
ul {
padding-left: constant(safe-area-inset-left);
padding-right: constant(safe-area-inset-right) list-style: none;
width: 100%;
background-color: #A4F4B0;
}
li {
list-style: none;
height: 50px;
width: 100%
}
/*iPhoneX的适配*/
@media only screen and (device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3) {
header {
background-color: black;
}
}
/*iPhone8P的适配*/
@media only screen and (device-width: 414px) and (device-height: 736px) and (-webkit-device-pixel-ratio: 3) {
header {
background-color: deepskyblue;
}
}
</style>
</head>
<body>
<header>
<button type="button" name="button">返回</button> 头部
</header>
<ul>
<li>第一条</li>
<li>第一条</li>
<li>第一条</li>
<li>第一条</li>
<li>第一条</li>
<li>第一条</li>
<li>第一条</li>
<li>第一条</li>
<li>第一条</li>
<li>第一条</li>
<li>第一条</li>
<li>第一条</li>
<li>第一条</li>
<li>第一条</li>
<li>第一条</li>
<li>第一条</li>
<li>第一条</li>
<li>第一条</li>
<li>第一条</li>
<li>第一条</li>
<li>第一条</li>
<li>第一条</li>
<li>第一条</li>
<li>第一条</li>
<li>第一条</li>
<li>第一条</li>
<li>第一条</li>
<li>第一条</li>
<li>第一条</li>
<li>第一条</li>
<li>第一条</li>
<li>第一条</li>
<li>第一条</li>
<li>第一条</li>
<li>第一条</li>
</ul>
<footer>
<button type="button" name="button">返回</button> 底部
</footer>
</body>
</html>