关于CSS预处理器less的使用(未完待续)
简单明了,直接上教程:
下面我们先大体了解些我接下来讲的less的功能特性:
属性
嵌套
混合方法
继承
导入
函数
其他
1、属性
(1)、值变量
@dividerColor:#000;
div{
background: @dividerColor;
}
(2)、选择器变量
@footer: .footer;
@{footer}{
}
(3)、属性变量
@color:color;
div{
@{color}:#000;
}
(4)、url 变量
@images:’…/images’ ;
div{
background:url(’@{images}/img.png’);
}
(5)、声明变量
结构: @name: { 属性: 值 ;};
使用:@name();
@background: {background:red;};
#main{
@background();
}
(6)、变量运算
@width:300px;
@color:#222;
div{
width:@width-20;
height:@width-20*5;
margin:(@width-20)5;
color:@color2;
更多内容请见原文,原文转载自:https://blog.csdn.net/weixin_44519496/article/details/120152637

浙公网安备 33010602011771号