首页 > 网站 > WEB开发 > 正文

CSS_LESS 语法/函数详解

2024-04-27 14:35:49
字体:
来源:转载
供稿:网友
CSS_LESS 语法/函数详解

嵌套规则

01#header{color:black;}#header.navigation{font-size:12px;
02}#header.logo{
03width:300px;
04}#header.logo:hover{text-decoration:none;
05}
06
07#header{color:black;.navigation{font-size:12px;
08}.logo{width:300px;
09&:hover{text-decoration:none}
10}
11}

变量:

1@nice-blue:#5B83AD;
2@light-blue:@nice-blue+#111;
3#header{color:@light-blue;}

伪类写法:

1a{
2color:red;
3&:hover{color:blue;}
4&:active{color:green;}
5}

COLOR颜色函数:

01lighten(@color,10%);//returnacolorwhichis10%*lighter*than@color
02darken(@color,10%);//returnacolorwhichis10%*darker*than@color
03
04saturate(@color,10%);//returnacolor10%*more*saturatedthan@color
05desaturate(@color,10%);//returnacolor10%*less*saturatedthan@color
06
07fadein(@color,10%);//returnacolor10%*less*transparentthan@color
08fadeout(@color,10%);//returnacolor10%*more*transparentthan@color
09fade(@color,50%);//return@colorwith50%transparency
10
11spin(@color,10);//returnacolorwitha10degreelargerinhuethan@color
12spin(@color,-10);//returnacolorwitha10degreesmallerhuethan@color
13
14mix(@color1,@color2);//returna
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表