現在のコードを使用しています
#extra-sidebar , .entry-content:not(#post-262){
background-color: rgba(255,255,255,0.8);
}
実際には #extra-sidebar だけでなく、.entry-content 全体にも影響します。entry-content の影響を受ける #post-262 については例外を設けたいと思います
ありがとうございました
現在のコードを使用しています
#extra-sidebar , .entry-content:not(#post-262){
background-color: rgba(255,255,255,0.8);
}
実際には #extra-sidebar だけでなく、.entry-content 全体にも影響します。entry-content の影響を受ける #post-262 については例外を設けたいと思います
ありがとうございました
IE8 以前は :not セレクターをサポートしていません。
次のように、クラスを別のクラスでオーバーライドするのが最善です。
#extra-sidebar, .entry-content{
background-color: rgba(255,255,255,0.8);
}
.entry-content #post-262{
background: none;
}
まあ方法は使用することでした
#post-262 {
background-color:#previousvalue!important;
}
:not()
関数を使用する必要はなく、!important
優先順位を設定するだけで十分です。
#post-262
それは実際には.entry-content
要素の子であり(またはその逆)、それらは同一ではないという推測で正しいでしょうか?
#post-262
その場合、背景色をコンテナの背後にあるものと同じに上書きするスタイルを定義する必要があります。