开发者

CSS style oveloading

CSS style oveloading

In this image I want to have #bf0018 as the val开发者_StackOverflow社区ue of the property colour

Can anyone help me ....


You have to understand CSS hierarchy. The file that contains this color, must be below the other files that contains different color for the same class. If there are many color properties in the same file for the same class, then the the "correct" one must me the last, to override the rest. In case that you can't change file positions in the document, or you don't want to change the structure of css files, you can add !important next the value like .highlight {color: #bf0018 !important;} but this is the last suggestion.


I don't think you should use !important. Using !important will most likely mess up your styling in the long run. Instead read on css specificity. Two sources of information:

  • w3
  • smashingmagazine

In your example can't you open typography.css and change the value? You shouldn't use !important as suggested in other answers.


Either load your TResWinIE stylesheet last so that the declaration comes last, or add !important to the rule in the TResWinIE stylesheet so it looks like so:

.highlight
{
   color: #bf0018 !important;
}


You should use !important keyword to override all the other styles

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜