使用CSS @Variables [英] Using CSS @Variables
本文介绍了使用CSS @Variables的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想使用CSS变量。我看网上的教程和所有的工作到目前为止。
I am trying to use CSS Variables. I look online for tutorials and all of them worked so far.
这是我的CSS:
@variables {
defaultColor: #8E5050;
defaultBackGround: #E1DBC3;
}
body {
background: var(defaultBackGround);
}
a {
color: var(defaultColor);
}
我也尝试过:
body {
background: @defaultBackGround;
}
a {
color: @defaultColor;
}
它们都不工作,我做错了什么?感谢
None of them works, What am I doing wrong? Thanks
推荐答案
I would use a CSS preprocessor such as Sass or Less.
这篇关于使用CSS @Variables的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文