2013-06-25 94 views
0

我使用的是當前的代碼正確的語法:不是()CSS

#extra-sidebar , .entry-content:not(#post-262){ 
background-color: rgba(255,255,255,0.8); 
} 

它實際上影響了我的#特側邊欄也是我.entry內容完全。 我想提出的#後的262,它由入門內容

謝謝

+0

分別爲'.entry-content:not(#post-262)' – Aravind30790

+0

編寫你的css這個完成取決於你的HTML的樣子。 –

回答

0

請問我在猜測,#post-262實際上是一個.entry-content元素的子是正確的受影響的異常(或相反的方式),而且他們不是一樣的?

如果是這樣,您將需要定義一個#post-262的樣式,該樣式覆蓋背景顏色與容器背後的顏色相同。

+0

.entry-content適用於所有帖子。 – dansayag

+0

#262後面是

+0

類,但如果我這樣做它does not work。入門內容{ background-color:rgba(255,255,255,0.8); } #262後面{ background-color:transparent; } – dansayag

2

IE8和更早版本不支持:不是選擇器。

它最好只覆蓋類與其他類,像這樣:

#extra-sidebar, .entry-content{ 
    background-color: rgba(255,255,255,0.8); 
} 

.entry-content #post-262{ 
    background: none; 
} 
0

那麼的方法是使用

#post-262 { 
    background-color:#previousvalue!important; 
} 

無需使用:not()功能,!important足以設置優先級。