美文网首页
webpack移动端rem适配方案

webpack移动端rem适配方案

作者: famingng | 来源:发表于2018-10-31 11:05 被阅读0次

    1.安装hotcss

    cnpm install hotcss -S

    2.引入hotcss.js到页面

    3.引入px2rem.scss

    @import 'node_modules/hotcss/src/px2rem.scss';

    4.设置设计尺寸

    $designWidth: 750;

    5.用px2rem函数转换

    padding: px2rem(20) px2rem(24);

    相关文章

      网友评论

          本文标题:webpack移动端rem适配方案

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