//计算根节点HTML的字体大小
function resizeRoot(){
var deviceWidth = document.documentElement.clientWidth,
num = 750,
num1 = num / 100;
if(deviceWidth > num){
deviceWidth = num;
}
document.documentElement.style.fontSize = deviceWidth / num1 + "px";
}
//根节点HTML的字体大小初始化
resizeRoot();
window.onresize = function(){
resizeRoot();
};
相关文章:
- 移动端h5页面的设计稿尺寸 2021-12-14
- 手机H5页面rem值 2021-06-02
- 页面尺寸设置 2022-02-09
- 移动端H5页面rem缩放方案flexible.js兼容375px方案的思路 2021-12-09
- H5 设计尺寸 2021-12-14
- H5页面移动端兼容性测试 2021-11-08
- h5设计图尺寸 2021-12-14
- 移动端尺寸新写法-rem 2021-10-05