首页 > 其他 > 详细

less 学习

时间:2015-06-29 00:19:47      阅读:231      评论:0      收藏:0      [点我收藏+]

1.~

将 字符串中的“ 给去掉

@index:2;     @aa:~ ".col-xs-@{index}, .col-sm-@{index}, .col-md-@{index}, .col-lg-@{index}";

调用

@{aa}{     position:relative; }

 生成css

.col-xs-2, .col-sm-2, .col-md-2, .col-lg-2 {
  position: relative;
}

2.{index}

在字符串中链接变量

3.循环when

 

.text(@index) when (@index < 4){   .textcss{  -col@{index}{color:blue;}   }   .text(@index+1) }

.text(1);

css

.textcss -col1 {
  color: blue;
}
.textcss -col2 {
  color: blue;
}
.textcss -col3 {
  color: blue;
}

 

less 学习

原文:http://www.cnblogs.com/lavenvsxiaoye/p/4606285.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!