less常用
来源:互联网 发布:淘宝买东西要身份证 编辑:程序博客网 时间:2024/06/06 04:17
@charset "utf-8";
//变量
@awidth:200px;
body{
background-color:red;
}
.box{
width:@awidth;
.border;
}
//混合
.border{
height:200px;
}
//混合可带参数
.classone(@width){
width:@width;
}
.classtwo{
.classone(30px);
}
//混合默认参数
.class01(@height:10px){
height:@height;
}
.classtwo{
.class01;
}
//例子
.border_radius(@raduis){
-moz-border-radius:@raduis;
-webkit-border-radius:@raduis;
border-radius:@raduis;
}
.box{
.border_radius(20px);
}
//匹配模式
.a(a){
position: absolute;
}
.a(r){
position:relative;
}
.box{
.a(r);
}
//运算
@border:10px;
.borderone{
border:@border+20;
}
/*
嵌套
*/
ul{
background-colol: red;
margin:0px;
padding:0px;
li{
height: 30px;
line-height:30px;
// a{
// display:inline-block;
// }
}
a{ //尽量减少层级深度
display:inline-block;
&:hover{//&代表外一层对象
color:red;
}
}
}
//arguments,获取所有参数
.border_args(@w:30px,@c:red,@s:solid){
border:@arguments;
}
.border{
.border_args();
}
//变量
@awidth:200px;
body{
background-color:red;
}
.box{
width:@awidth;
.border;
}
//混合
.border{
height:200px;
}
//混合可带参数
.classone(@width){
width:@width;
}
.classtwo{
.classone(30px);
}
//混合默认参数
.class01(@height:10px){
height:@height;
}
.classtwo{
.class01;
}
//例子
.border_radius(@raduis){
-moz-border-radius:@raduis;
-webkit-border-radius:@raduis;
border-radius:@raduis;
}
.box{
.border_radius(20px);
}
//匹配模式
.a(a){
position: absolute;
}
.a(r){
position:relative;
}
.box{
.a(r);
}
//运算
@border:10px;
.borderone{
border:@border+20;
}
/*
嵌套
*/
ul{
background-colol: red;
margin:0px;
padding:0px;
li{
height: 30px;
line-height:30px;
// a{
// display:inline-block;
// }
}
a{ //尽量减少层级深度
display:inline-block;
&:hover{//&代表外一层对象
color:red;
}
}
}
//arguments,获取所有参数
.border_args(@w:30px,@c:red,@s:solid){
border:@arguments;
}
.border{
.border_args();
}
阅读全文
0 0
- 常用less
- less常用
- Less的常用语法总结
- linux常用终端命令之less
- CSS预处理语言Less常用语法
- LESS CSS 常用的10个实例
- CSS常用 Less 公共样式封装
- less
- less
- LESS
- less
- less
- less
- less
- less
- LESS
- less
- less
- 三级缓存
- 自定义video
- 莫烦PyTorch学习笔记(一)——Torch或Numpy
- 面试题总结(1)
- 《集体智慧编程》数学公式
- less常用
- 如何在 Azure 中均衡 Windows 虚拟机负载以创建具有高可用性的应用程序
- 无数四轴的航模常识
- IIS7 + Tomcat7 整合共用80端口
- Apache VirtualHost配置
- 浏览器最近浏览记录
- 助你快速踏入高薪职场——2017面试集锦之流行的框架与新技术
- Listener 监听器&&Spring使用Log4jConfigListener配置Log4j日志
- UE4蓝图节点翻译---Get Actor Eyes View Point