开发者

Class being over written by other class

开发者 https://www.devze.com 2023-02-12 17:58 出处:网络
Here is a simple CSS issue. I have site that has the following problem: #main-content ol { list-style-type: decimal;

Here is a simple CSS issue. I have site that has the following problem:

#main-content ol {
list-style-type: decimal;
padding-left: 25px;}                                  /* abc.css (line 140) */

#contentWrapper p, #contentWrapper ul, #contentWrapper ol, #lmBlurbsArchive {
color: #666666;
font-size: 1.1em;
margin-bottom: 12px;
margin-left: 0;
margin-right: 0;
margin-top: 0;}                                       /* abc.css (line 69) */

/* Code below being striped out/ over written by other class above */
ol.upper-roman {
list-s开发者_Python百科tyle-type: upper-roman;


#main-content ol.upper-roman should be specific enough to "win".

So, in your CSS, change ol.upper-roman to the above selector.

Give these a read:

  • http://css-tricks.com/specifics-on-css-specificity/
  • http://www.w3.org/TR/CSS2/cascade.html#specificity


A selector using an ID has a higher value than a selector using just a class, so #main-content ol is given preference over ol.upper-roman.

You´d have to use #main-content ol.upper-roman to overwrite the settings on line 140.

0

精彩评论

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