less避免编译

less里面有一个避免编译,有时候我们需要输出一些不正确的css语法或者使用less不认识的专有语法。要输出这样的值我们可以在字符串前加上一个~

/*避免编译*/

.test_03{
  width: 300px;
  height: calc(300px - 30px);
}
=>
.test_03 {
  width: 300px;
  height: calc(270px);
}
这个calc,有时候我们是让浏览器计算,不是让less计算
.test_03{
  width: 300px;
  height: ~'calc(300px - 30px)';
}
=>
.test_03 {
  width: 300px;
  height: calc(300px - 30px);
}

 

 

posted @ 2018-07-16 06:49  wzndkj  阅读(1108)  评论(0编辑  收藏  举报