标签:样式 场景 变量 一个 width height abc 参数 ack
.border{ border: 5px solid pink; } .box{ width: 300px;height:300px; .border; } => .border { border: 5px solid pink; } .box { width: 300px; height: 300px; border: 5px solid pink; }
.box{ width: 300px; height:300px; border:1px solid #abcdef; } .box2{ .box; margin-left: 100px; } => .box { width: 300px; height: 300px; border: 1px solid #abcdef; } .box2 { width: 300px; height: 300px; border: 1px solid #abcdef; margin-left: 100px; }
像这种重用的样式,直接拿过来
.border(@border_width){ border:@border_width solid pink; } .test_2{ .border(30px) } => .test_2 { border: 30px solid #ffc0cb; }
.border(@border_width:10px){ border:@border_width solid pink; } .test{ .border() } .test2{ .border(20px) } => .test { border: 10px solid #ffc0cb; } .test2 { border: 20px solid #ffc0cb; }
.border_radius(@rds:5px){ -webkit-border-radius:@rds; -moz-border-radius:@rds; border-radius: @rds; } .radius_test{ width: 100px; height: 40px; background-color:pink; .border_radius(); } => .radius_test { width: 100px; height: 40px; -color: pink; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; }
标签:样式 场景 变量 一个 width height abc 参数 ack
原文地址:https://www.cnblogs.com/wzndkj/p/9311806.html