移动端媒体查询适配

主要用于移动端内容适配,因为移动端有时候须要根据高度来进行适配,好比iPhone4和iPhone5的宽度同样,可是高度不一样html

/*iphone4*/
@media only screen and (max-width: 320px) and (max-width: 480px) {
html,body{
font-size: 12px;
}
}
/*iphone5*/
@media only screen and (max-width: 320px) and (min-height: 568px) {
html,body{
font-size: 14px;
}
}
/*ihpne6,7,8*/
@media only screen and (min-width: 375px) and (max-width: 413px) {
html,body{
font-size: 16px;
}
}
/*ihpne6,7,8Plus*/
@media only screen and (min-width: 414px) and (max-width: 640px) {
html,body{
font-size: 18px;
}
}iphone

相关文章
相关标签/搜索