自适应布局
-
设置viewport进行缩放
-
在html中设置font-size
rem等比例,设置html的font-size
-
通过设置html的font-size属性,其中计算如下:
那怎么确定html的font-size呢
其中宽度为屏幕宽度,
-
在vscode设置Root Font-Size
将px转为rem
参考vscode如何将px转换为rem-站长资讯网 (info110.com)
文件——》首选项——》设置——》扩展
-
root font-size = 750/10 = 75
(750为设计图的宽度,10为固定系数)
没有的话,在扩展里面安装:px2rem
疑惑:font-size=总屏幕宽度/系数,系数是固定的吗