动态获取页面大小,根据大小给html设置字体大小

来源:互联网 发布:淘宝淘口令怎么编辑 编辑:程序博客网 时间:2024/05/01 08:30
window.onresize=function(){    var html=document.getElementsByTagName("html")[0];    var width=window.innerWidth;    var font_Size=16/1920*width;    html.style.fontSize=font_Size+"px";};