@media screen and (min-width: 320px) {
html {
/* iPhone5的320px尺寸作为12px基准,以后所有型号按此比例缩放 */
font-size: calc(75% + (100vw - 320px) * 0.0375);
font-size: calc(12px + (100vw - 320px) * 0.0375);
}
}
@media screen and (min-width: 600px) {
html {
/* 600px-1000px每100像素宽字体增加1px(20px-24px) */
font-size: calc(125% + 4 * (100vw - 600px) / 400);
font-size: calc(20px + 4 * (100vw - 600px) / 400);
}
}
@media screen and (min-width: 1000px) {
html {
/* 1000px往后是每100像素0.5px增加 */
font-size: calc(137.5% + 6 * (100vw - 1000px) / 1000);
font-size: calc(22px + 6 * (100vw - 1000px) / 1000);
}
}
body{
font-size: 1rem;
}
html {
/* iPhone5的320px尺寸作为12px基准,以后所有型号按此比例缩放 */
font-size: calc(75% + (100vw - 320px) * 0.0375);
font-size: calc(12px + (100vw - 320px) * 0.0375);
}
}
@media screen and (min-width: 600px) {
html {
/* 600px-1000px每100像素宽字体增加1px(20px-24px) */
font-size: calc(125% + 4 * (100vw - 600px) / 400);
font-size: calc(20px + 4 * (100vw - 600px) / 400);
}
}
@media screen and (min-width: 1000px) {
html {
/* 1000px往后是每100像素0.5px增加 */
font-size: calc(137.5% + 6 * (100vw - 1000px) / 1000);
font-size: calc(22px + 6 * (100vw - 1000px) / 1000);
}
}
body{
font-size: 1rem;
}