Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Mar 2010
    Posts
    235
    Thanks
    39
    Thanked 6 Times in 6 Posts

    Override parent div if it contains a div

    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.

  • #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    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:
    Code:
    #extra #featured {
    }
    #extra #featured #block {
    }
    See a page about specificity here.
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •