0

I'm using the current code

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

It actually affects my #extra-sidebar but also my .entry-content entirely. I would like to make an exception for the #post-262 which is affected by the entry-content

Thank you

2
  • write your css seperately for .entry-content:not(#post-262) Commented Jun 25, 2013 at 11:09
  • This complete depends on how your HTML looks like. Commented Jun 25, 2013 at 11:09

3 Answers 3

2

IE8 and earlier do not support the :not selector.

It's best to just override the class with another class like so:

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

.entry-content #post-262{
   background: none;
}
Sign up to request clarification or add additional context in comments.

Comments

0

Would I be correct in guessing that #post-262 is actually a child of an .entry-content element (or the other way around), and that they are not one and the same?

If so, you will need to define a style for #post-262 that overrides the background colour to the same as whatever's behind the container.

4 Comments

.entry-content is for all the posts.
#post-262 is <article id> and entry-content is class
but if i do this it doesnt work .entry-content { background-color: rgba(255,255,255,0.8); } #post-262 { background-color: transparent; }
What exactly do you think transparent is going to achieve? It's like... take a translucent sheet of white plastic and put it on your desk. Everything under it looks washed out, right? Now put some clear plastic on top of that. Does the desk become its original colour again?
0

Well the way was to use

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

No need to use :not() function, !important is enough to set priorities.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.