Grow your CSS skills. Land your dream job.

How to apply CSS rule to div inside other divs div1>div2>div3

  • # January 28, 2013 at 6:41 pm

    Hello !

    I have a website i’m working on that has a class which is shared by other areas besides the one i want to apply rule to (i want to apply CSS rule to right column header only), which is at bottom header of each module .
    Basically what I want to do is to know how to write the css rules so they’ll only be applied to the header of this right column.

    You can check http://deckheads.pt/index.php?Itemid=293 for this

    `h3.header` affects all header

    This `h3.header` is inside `div` with `id=dhRightTop` and `class=dhMain`

    I tried stuff like `h3.header#dhRighttop, div.dhmain.h3.header , div#dhdhRightTop.h3.header`, but nothing seems to work.

    Here’s the div order :

    `div id=dhright class=dhcol > div id=dhrighttop class=dhmain > div class=box > h3 class = header`

    Thank you

    # January 28, 2013 at 7:17 pm

    I think you want something like:

    `#dhrighttop h3.header`

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".