-1

I want to apply !important to all div,p,pre, and span elements, overwriting all properties which are currently written inline. For example:

.contpost p,pre,span,div{
    color:#4c4c4c !important;
}

Does this color now apply to the whole page and specifically to that div?

4

2 回答 2

3

也许你是这个意思?没有更多信息,这有点模糊。

.contpost p,
.contpost pre,
.contpost span,
.contpost div{
    color:#4c4c4c!important;
}
于 2013-07-05T12:51:09.407 回答
0

你可以在body标签中添加一个id,比如

<body id="container">

然后使用

#container div{color:value !important;} 
#container p{color:value !important;}
#container pre{color:value !important;}
#container span{color:value !important;}

或者只是将它们组合成一个:

 #container div, #container p, #container pre, #container span{color:value !important;} 
于 2013-07-05T12:52:40.123 回答