VScode cssrem插件使用 详细教程
2018-01-18 本文已影响1720人
丘比特爱上猫
VScode cssrem插件使用 详细教程
1. 下载插件
打开扩展,搜索cssrem如图:点击安装

2. 重新加载
下载安装完成重新加载一遍,使插件生效

3. 设置根字体
点击VScode左下方图标,选中设置


往下滑到cssrem,三个选项随你改

改完之后重启!!!!
改完之后重启!!!!
改完之后重启!!!!

大功告成!
项目中rem做适配的使用
!function(win,doc){
var d=doc.documentElement;
function change(){
d.style.fontSize= d.clientWidth/96+'px';
}
win.addEventListener('resize',change,false);
change();
}(window,document);