码迷,mamicode.com
首页 > 其他好文 > 详细

rem适配

时间:2018-05-19 18:50:22      阅读:161      评论:0      收藏:0      [点我收藏+]

标签:lse   fonts   span   width   col   nta   font   res   cli   

var docEl = document.documentElement,resizeEvt = ‘orientationchange‘ in window ? ‘orientationchange‘ : ‘resize‘;
var clientWidth = docEl.clientWidth;
if(clientWidth>=750){
    docEl.style.fontSize = ‘100px‘;
}
else{
    docEl.style.fontSize = 100 * (clientWidth / 750) + ‘px‘;
}

 

rem适配

标签:lse   fonts   span   width   col   nta   font   res   cli   

原文地址:https://www.cnblogs.com/SunShineM/p/9060802.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!