我已经定义了一些我将在我的网站上使用的背景颜色。所以,我可以轻松设置像不同元素的背景色:现在链接CSS规则
.background_highlite{
background-color: rgb(231, 222, 207); /*Cream in my Coffee*/
}
.background_shadow{
background-color: rgb(201, 179, 156); /*Moose Mousse*/
}
,如果我想我的页面上的所有textarea
元素有驼鹿慕斯的颜色作为他们的背景,我想写引用回到另一个CSS规则.background_shadow,所以我只需要在一个地方更改rgb值。
喜欢的东西:
textarea{
height:50px;
background-color: background_highlite /* want to feed forward to keep the rgb in one place */
}
这可能与CSS?
简短的回答:不,不是用普通的CSS – knittl 2010-07-11 16:39:55