移动端html5手机网站字体单位font-size选择px还是rem
分为两种情况:
①对于只需要适配手机设备,使用px就可以了
②对于需要适配各种移动设备,使用rem,例如只需要适配iPhone和iPad等分辨率差别比较挺大的设备。
rem参考代码:
html {font-size:10px}
@media screen and (min-width:480px) 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) and (max-width:959px) {
html {
font-size: 25px
}
}
@media screen and (min-width:960px) and (max-width:1079px) {
html {
font-size: 30px
}
}
@media screen and (min-width:1080px) {
html {
font-size: 32px
}
}
以上就是本篇文章【移动端html5手机网站字体单位font-size选择px还是rem】的全部内容了,欢迎阅览 ! 文章地址:http://ww.kub2b.com/news/6648.html
栏目首页
相关文章
动态
同类文章
热门文章
网站地图
返回首页 企库往资讯移动站 http://ww.kub2b.com/mobile/ , 查看更多