我有這樣的HTML:重要的CSS類沒有被應用?
.text-success {
width: 75px;
padding: 1px;
color: #4c9709;
}
.SomethingOrOther {
padding: 0px 0px 0px 37px !important;
color: #FFA500 !important;
}
.lineheight {
line-height: 21px !important;
}
<b><span id="lblSomethingOrOther" class="text-success lineheight SomethingOrOther"><a onclick="SomeAction('Something', 'Other');"><u>Text which appears incorrectly</u></a></span></b>
在text-success
類中,我們採用了一些東西,但其中之一是color: #4c9709;
(綠色)。 SomethingOrOther
類也適用color: #FFA500 !important;
(橙色),但是當我運行該軟件時,文本是錯誤的顏色;它使用text-success
的綠色。
爲什麼它不尊重!important
標誌並使用第二種顏色?試過IE,Chrome和Firefox。
我可以可能從HTML刪除text-success
類但這是正確的行爲我們的Live服務器上,但不是我們的本地測試服務器,我想弄清楚爲什麼...
能否請你分享你的CSS? –
我看到橙色https://jsfiddle.net/6xjj4kr4/ –
嘗試添加更多的特殊性 - 'b span.SomethingOrOther'(如果該類是頁面唯一的而不是全局的) – ThisGuyHasTwoThumbs