web移动端CSS使用em单位设置font-size自适应

:root {
font-size: 16px;
}

@media only screen and (min-device-width: 375px) and (max-device-width: 667px) and (-webkit-device-pixel-ratio: 2) {
:root {
font-size: 18.75px;
}
}

@media only screen and (min-device-width: 414px) and (max-device-width: 736px) and (-webkit-device-pixel-ratio: 3) {
:root {
font-size: 20.7px;
}
}

@media screen and (min-width: 414px) {
:root {
font-size: 20.7px;
}
}

 

你可能感兴趣的:(web移动端CSS使用em单位设置font-size自适应)