View Full Version : Override parent div if it contains a div

11-23-2011, 08:56 PM
We have a div called #featured on every page. However, for one of the pages that contains another div called #block, we don't want the css for #feature used. Is there a way to check to see if a div contains a div?

Note: We are using Drupal, so not using the "Feature" on this page is not an option unfortunately.

11-23-2011, 09:56 PM
Hello mathceleb,
Give the page that has the extra #block an id on it's body tag. <body id="extra"> would do just fine.
The you can specifically target this pages #featured and #block like this:

#extra #featured {
#extra #featured #block {

See a page about specificity here (http://reference.sitepoint.com/css/specificity).