以375px寬度16px爲基礎
@media only screen and (min-width: 320px) {
html {
font-size: 13.65px !important;
}
}
@media only screen and (min-width: 360px) {
html {
font-size: 15.36px !important;
}
}
@media only screen and (min-width: 375px) {
html {
font-size: 16px !important;
}
}
@media only screen and (min-width: 390px) {
html {
font-size: 16.64px !important;
}
}
@media only screen and (min-width: 414px) {
html {
font-size: 17.664px !important;
}
}
@media screen and (min-width: 640px) {
html {
font-size: 27.31px !important;
}
}
這樣就可以在css下使用rem來進行編寫樣式。