2013-10-07 47 views
0

下面是一個jQuery的CSS該行:不同的CSS在一個div

.ui-widget-header { 
    border: 1px solid #e78f08; 
    background: #f6a828 url(images/ui-bg_gloss-wave_35_f6a828_500x100.png) 50% 50% repeat-x; 
    color: #ffffff; 
    font-weight: bold; 
} 

我想改變的背景,沒有,只是在smalltabs DIV。然而,這並不工作(我只是試圖複製線):

#smalltabs { 
    border: none; 
    padding: 0; 
    .ui-widget-header { 
     border: 1px solid #e78f08; 
     background: none; 
     color: #ffffff; 
     font-weight: bold; 
    } 
} 
+1

你可以提供HMTL代碼與這個CSS? – LinkinTED

+1

安東的解決方案有效! –

回答

1

這個重要的使用和糾正選擇

#smalltabs { 
     border: none; 
     padding: 0; 
    } 
    #smalltabs .ui-widget-header { 
    border: 1px solid #e78f08; 
    background: none !important; 
    color: #ffffff; 
    font - weight: bold; 
} 
+4

我建議只使用'!important'規則來覆蓋內聯樣式。大多數情況下,您可以通過指定正確的方式解決問題! – LinkinTED

0
#smalltabs { 
    border: none; 
    padding: 0; 
    background: none; 
} 
0

這應該做的伎倆嘗試。

#smalltabs { 
border: none; 
padding: 0; 
.ui-widget-header { border: 1px solid #e78f08; background: transparant; color: #ffffff; font-weight: bold; } 
} 

它也可能是這種情況,它被否決。如果是這樣,試試這個

#smalltabs { 
border: none; 
padding: 0; 
.ui-widget-header { border: 1px solid #e78f08 !important; background: transparant !important; color: #ffffff !important; font-weight: bold !important; } 
} 

編輯:我不好,我在想背景顏色。試試這個:

 #smalltabs { 
border: none; 
padding: 0; 
.ui-widget-header { border: 1px solid #e78f08 !important; background: none !important; color: #ffffff !important; font-weight: bold !important; } 
}