Use :root
for Flexible Type
The type font size in a responsive layout should be able to adjust with each viewport. You can calculate the font size based on the viewport height and width using :root
:
:root {
font-size: calc(1vw + 1vh + .5vmin);
}
Now you can utilize the root em
unit based on the value calculated by :root
:
body {
font: 1rem/1.6 sans-serif;
}
Demo
当前内容版权归 AllThingsSmitty 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 AllThingsSmitty .