摘要: less里面是可以有运算的,任何数字,颜色或者变量都可以参与与暗算,运算应该被包裹在括号中。 @test_width:300px; .box_width{ width: (@test_width + 20) * 2;//这里面不用每个都带单位,只要有一个带单位就可以了 color: #cccccc 阅读全文
posted @ 2018-07-15 18:28 wzndkj 阅读(170) 评论(0) 推荐(0) 编辑
摘要: less里面的匹配模式相当于js里面的if,但又不完全是,比如用css画一个三角 html <div class="sanjiao"></div> less .sanjiao{ width: 0px; height: 0px; overflow: hidden; border-width: 10px 阅读全文
posted @ 2018-07-15 18:11 wzndkj 阅读(1324) 评论(0) 推荐(0) 编辑
摘要: 混合(mixin)变量 .border{ border: 5px solid pink; } .box{ width: 300px;height:300px; .border; } => .border { border: 5px solid pink; } .box { width: 300px; 阅读全文
posted @ 2018-07-15 08:41 wzndkj 阅读(189) 评论(0) 推荐(0) 编辑
摘要: less中的变量用@符号,例如@变量名:值 @text_width:300px; .box{ width: @text_width; } => .box { width: 300px; } 阅读全文
posted @ 2018-07-15 08:04 wzndkj 阅读(162) 评论(0) 推荐(0) 编辑
摘要: less中的注释 1、可以使用css中的注释(/***/) 2、也可以用//注释 //编译时会自动过滤掉 /**我是会被编译的*/ ul{ // padding: 0px; // height: 100px; } => /**我是会被编译的*/ 阅读全文
posted @ 2018-07-15 08:00 wzndkj 阅读(156) 评论(0) 推荐(0) 编辑