美文网首页
自适应布局-rem

自适应布局-rem

作者: 仰望天空的人 | 来源:发表于2018-06-05 18:12 被阅读3次

    code:

        var winWidth =  window.innerWidth;
        var size = (winWidth / 640) * 100;
        // 以 640 为例
        document.documentElement.style.fontSize = (size < 100 ? size : 100) + 'px' ;
    

    配合:

        [点击此处](https://www.jianshu.com/p/30251fecde1d)
    

    然后,至此,就可以开始你的移动端自适应网页之路了!再会

    相关文章

      网友评论

          本文标题:自适应布局-rem

          本文链接:https://www.haomeiwen.com/subject/lnsmsftx.html