Hiding a div based on parent div - Possible?

kumakumasan
avatar
rank Regular

Regular


Posts: 13
Joined: 2008-10-10

I have a div that I want to display in one view, but not the other. Is something like this possible:

<div ID="View_1">
    <div CLASS="Hide_in_view_1">
    </div>
</div>

<div ID="View_2">
    <div CLASS="Hide_in_view_1">
    </div>
</div>

What would the css code be? Something like:
div.Hide_in_view_1 {
    display: none;
}

But this would hide in both views... Please help!

Thank you!

Hugo
Hugo's picture
rank Moderator

Moderator


Posts: 12583
Joined: 2004-06-06
Location: London

Descendent

Descendent selectors!

#view_1 div.Hide_in_view_1 {display:none;}

Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me