摘要: 实例:1920*1080的电脑屏幕 1、获取窗口中的文档显示区域宽高 2、获取窗口(包括滚动条与工具条)区域宽高 1与2 的区别在于:是否包含工具条 当我们按下F12的时候,就会发现区别很明显了 3、获取网页可见区域宽高 4、获取网页可见(含边线,但不是边距)区域宽高 3与4的区别在于:是否包含边线 阅读全文
posted @ 2017-01-24 14:08 YanEr、 阅读(2772) 评论(0) 推荐(0) 编辑
摘要: Less符号 逗号 example: .test() { box-shadow+: inset 0 0 10px #555; } .study { .test(); box-shadow+: 0 0 20px black; } //output css .study { box-shadow: in 阅读全文
posted @ 2017-01-20 11:50 YanEr、 阅读(3367) 评论(0) 推荐(0) 编辑
摘要: loop循环 example: .test(@i) when (@i > 0) { .test((@i - 1)); .study@{i} { width: (10px * @i); } } div{ .test(2); } //output css div .study1 { width: 10p 阅读全文
posted @ 2017-01-19 17:57 YanEr、 阅读(390) 评论(0) 推荐(0) 编辑
摘要: mixin卫士--判断 或与且语法 且:()and() 或:(),() --且 examlpe: .test(@a) when (isNumber(@a)) and (@a>=5){ font-size:unit(@a,px); } .study{ .test(10); } //output css 阅读全文
posted @ 2017-01-19 17:38 YanEr、 阅读(384) 评论(0) 推荐(0) 编辑
摘要: mixin卫士--判断 类似于JavaScript的if/else example: .test(@a) when (@a>10){//当大于10 font-size:18px; } .test(@a) when (@a<=10){//当小于等于10 font-size:12px; } .test( 阅读全文
posted @ 2017-01-19 17:03 YanEr、 阅读(2828) 评论(0) 推荐(0) 编辑
摘要: //@import 导入选项 --@import 可以至于任何你需要导入的地方 在标准的CSS,@import在规则必须先于所有其他类型的规则。但Less.js不关心 example: .test(){ color:#ff6a00; } .study{ .test; } @import "study 阅读全文
posted @ 2017-01-19 15:04 YanEr、 阅读(34512) 评论(0) 推荐(0) 编辑
摘要: //Mixins --立即执行函数 .test{/* */} #test{/* */} --指定执行函数 .test(){/* */} #test(){/* */} --调用: .test; or .test(); #test; or #test(); 这些函数,你可以用css的各种选择器去命名 - 阅读全文
posted @ 2017-01-18 18:00 YanEr、 阅读(531) 评论(0) 推荐(0) 编辑
摘要: //mixin传参 --简单传参,example: .border-radius(@radius) { -webkit-border-radius: @radius; -moz-border-radius: @radius; border-radius: @radius; } .callUse{ . 阅读全文
posted @ 2017-01-18 15:10 YanEr、 阅读(5431) 评论(0) 推荐(0) 编辑
摘要: //!important关键字 使用!important关键字混入调用之后,以标记它继承的所有属性!important,example: .test{ background:red; font-size:18px; color:blue; } .study{ .test()!important; } 阅读全文
posted @ 2017-01-18 14:29 YanEr、 阅读(2274) 评论(0) 推荐(0) 编辑
摘要: //mixin函数 基础使用方法 --包含选择器,example: .test(){ &:hover{ border:1px solid red; } } button{ .test; } //output css button:hover { border: 1px solid red; } -- 阅读全文
posted @ 2017-01-18 14:14 YanEr、 阅读(451) 评论(0) 推荐(0) 编辑