2011-08-09 63 views
0

我带指南针框架内工作,并将其重置了很多默认的CSS样式:浏览器不重写CSS属性

..., h1, .. {    // line number 18 
    margin: 0; 
    padding: 0; 
    border: 0; 
    font-size: 100%; 
    font: inherit; 
    vertical-align: baseline; 
} 

下面我定义我的风格为h1

h1 {      // line number 77 
    font-weight: bold; 
    color: #333; 
    padding: 15px, 5px, !important; 
} 

但Chrome浏览器不接受填充属性并保持为0.所有其他属性均为正常。

为什么浏览器不接受较低的css属性?谢谢

+0

http://stackoverflow.com/questions/3242870/why-isnt-my-important-attribute-working-in-google-chrome – JMichelB

+0

你真的需要'!important'填充? – MikeM

+0

不,我只是想强制浏览器使用我的风格 – megas

回答

1

您的代码修改,

h1 {      // line number 77 
    font-weight: bold; 
    color: #333; 
    padding: 15px 5px !important; 
} 

之前重要的逗号只是删除。

请试试这个..

+0

仍然无法正常工作 – megas

+0

对不起,亲爱的只是把填充:15px 5px!重要; – anglimasS

+0

我在逗号后删除15px – anglimasS

1

!important之前不应该有逗号,因此它不被遵守。

+0

固定,但它没有工作 – megas