Forum Moderators: not2easy

Message Too Old, No Replies

Grouping Descendants

How do you group multiple descendents with differen't properties?

         

acemaster

9:34 pm on Feb 6, 2009 (gmt 0)

10+ Year Member



Hello All,

I'm wondering if there is a way to group descendents that have different properties. Ex:


#content div {
text-align: center;
color: red;
}

#content a {
color: blue;
text-decoration: none;
}

#content h1 {
color: yellow;
}

Turn the above into something like:


#content{
div {
text-align: center;
color: red;
}

a {
color: blue;
text-decoration: none;
}

h1 {
color: yellow;
}
}

Is this possible at all? Or do I just need to add #content in front of every descendent?

Thanks in advance for your help

swa66

10:36 pm on Feb 6, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Think you'll need to add it to all your selectors if you want it to only work for elements that have the element with that id as a parent.

acemaster

9:40 am on Feb 7, 2009 (gmt 0)

10+ Year Member



That's what I thought, but it never hurts to ask.

Thanks for the response!