开发者

How to use variable in CSS? [duplicate]

This question already has answers here: Closed 11 years ago.

Possible Duplicate:开发者_JAVA技巧

Create a variable in .CSS file for use within that .CSS file

I heard about that we can declare/define variable in CSS and use them like global variables like this:

@nice-blue: #5B83AD;

#header { color: @nice-blue; }

So anyone knows how to use them?


For that you need to use Less or Sass which are CSS Dynamic languages.

here's some comparison between both technologies.


You need to use something like SASS

http://sass-lang.com/#variables

or Less

http://lesscss.org/


There is a language written on top of CSS which make use of variables like you asked, it's called LessCSS

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜