Less符号

逗号

example:
.test() {
box-shadow+: inset 0 0 10px #555;
}
.study {
.test();
box-shadow+: 0 0 20px black;
} //output css
.study {
box-shadow: inset 0 0 10px #555, 0 0 20px black;
}

属性后跟“ + ”,就是“ , ”

空格

example:
.test() {
transform+_: scale(2);
}
.study {
.test();
transform+_: rotate(15deg);
} //output css
.study {
transform: scale(2) rotate(15deg);
}

属性后跟“ +_ ”,就是空格

“ & ”父级选择器


example 1:
a {
color: blue;
&:hover {
color: green;
}
} //output css
a {
color: blue;
}
a:hover {
color: green;
}

example 2:
.test{
&-complete{
background-color:red;
}
&-undone{
background-color:blue;
}
&-normal{
background-color:pink;
}
} //output css
.test-complete {
background-color: red;
}
.test-undone {
background-color: blue;
}
.test-normal {
background-color: pink;
}
example 3:
.link {
& + & {
color: red;
} & & {
color: green;
} && {
color: blue;
} &, &ing {
color: cyan;
}
} //output css
.link + .link {
color: red;
}
.link .link {
color: green;
}
.link.link {
color: blue;
}
.link,
.linking {
color: cyan;
}
example 4:(改变选择器顺序)
.test{
.study{
border:1px solid #ff6a00;
.menus &{
font-size:12px;
color:#ff0000;
}
}
} //output css
.test .study {
border: 1px solid #ff6a00;
}
.menus .test .study {
font-size: 12px;
color: #ff0000;
}
example 5:(组合迸发)
ul,li,a{
font-size:16px;
& + &{
margin-right:5px;
}
} //output css
ul,
li,
a {
font-size: 16px;
}
ul + ul,
ul + li,
ul + a,
li + ul,
li + li,
li + a,
a + ul,
a + li,
a + a {
margin-right: 5px;
}

组合迸发会将你选中的选择器的所有可能组合全部选中并编译输出。

作者:leona

原文链接:http://www.cnblogs.com/leona-d/p/6322425.html

版权声明:本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文链接

最新文章

  1. [js开源组件开发]loading加载效果
  2. 理解button标签的默认行为
  3. json不转化值是null的字段
  4. 关于xcode不同版本打开相同工程问题
  5. jstl的mavin依赖
  6. java之IO
  7. Linux 下memcache安装及使用
  8. storyBoard中的Segue跳转
  9. Repeater绑定数据库
  10. C# Best Practices - Handling Strings
  11. JS+CSS简单实现DIV遮罩层显示隐藏
  12. IntelliJ IDEA(六) :Settings(下)
  13. C#中try catch finally的执行顺序
  14. Sql Server索引重建
  15. Berlekamp-Massey算法学习笔记
  16. WIN10+ VS2013 配置Opencv2413 64位
  17. Architecture.SOLID-Principles
  18. 论文阅读 | Clustrophile 2: Guided Visual Clustering Analysis
  19. CentOS下yum安装mcrypt错误:No package php-mcrypt available.解决方法
  20. C语言基础:初级指针 分类: iOS学习 c语言基础 2015-06-10 21:50 30人阅读 评论(0) 收藏

热门文章

  1. centos7(vmware install) 安装EMQ注意事项 ---控制台远程访问
  2. android 屏幕适配原则
  3. TCP网络传输, 数据类型的问题
  4. C语言指针的易错点
  5. ehcache object key的实现原理
  6. mysql 添加缓存
  7. apache设置头
  8. FPGA学习(第8节)-Verilog设计电路的时序要点及时序仿真
  9. 品茗论道说广播(Broadcast内部机制讲解)(下)
  10. UVA812-Trade on Verweggistan(暴力)