简单h5开发的适配代码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
html{font-size:10px}

@media screen and (min-width:321px) and (max-width:375px){
html{font-size:11px}
}
@media screen and (min-width:376px) and (max-width:414px){
html{font-size:12px}
}
@media screen and (min-width:415px) and (max-width:639px){
html{font-size:15px}
}
@media screen and (min-width:640px) and (max-width:719px){
html{font-size:20px}
}
@media screen and (min-width:720px) and (max-width:749px){
html{font-size:22.5px}
}
@media screen and (min-width:750px) and (max-width:799px){
html{font-size:23.5px}
}
@media screen and (min-width:800px){
html{font-size:25px}
}

这种做法只适用于单屏显示的h5,一般的移动端开发,我会选择这种做法