首页  >  文章  >  web前端  >  less简单实用的案列

less简单实用的案列

php中世界最好的语言
php中世界最好的语言原创
2018-03-12 16:26:201456浏览

这次给大家带来less简单实用的案列,使用less的注意事项有哪些,下面就是实战案例,一起来看一下。

//这里是一些简单的LESS语法@width:400px;@height:300px;@font_size:12px;@bgColor: #000;textarea {
    width:@width;
    height:@height;
    
font-size
:@font_size;
    
background-color
: @bgColor;
}
.frame {
    .fun(123px);
    background-color: @bgColor;
    .select {
    width: 100px
  }
}
.fun(@px) {
  height: @px
}

编译成 CSS 后的代码为

textarea {  width: 400px;  height: 300px;  font-size: 12px;  background-color: #000000;
}.frame {  height: 123px;  background-color: #000000;
}.frame .select {  width: 100px;
}

相信看了本文案例你已经掌握了方法,更多精彩请关注php中文网其它相关文章!

相关阅读:

Rxjs的使用详解

js-xlsx的工具类库xlsxUtils的使用详解

javascript怎样做出决策树

以上是less简单实用的案列的详细内容。更多信息请关注PHP中文网其他相关文章!

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn