开发者

Multiple Parameters in Less.Js

Can I use multiple parameters in a class? For instance I'd like to give a div both border radius and a background color. How would I do this?

Here is an example of what I am trying to do:

.button (@radius, @color) {
  border-radius: @radius;
  -moz-border-radius: @radius;
  -webkit-border-radius:开发者_C百科 @radius;
  background:@color;
}


The correct way is to separate them by commas.

.button (@radius 4px, @color #000) {
   border-radius: @radius;
   -moz-border-radius: @radius;
   -webkit-border-radius: @radius;
   background:@color;
}

Don't separate them by semi colons.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜