Home  |  About  | Last |  Submit  |  Contact
AllQuests.com

Previous Question:  Borders Padding in different browsers  CSSNext Question:  CHeck this out.  CSS
Question Child DIV Styles based on Partent DIVs style ( SitePoint Forums CSS )
Updated: 2008-11-23 03:55:01 (1)
Child DIV Styles based on Partent DIVs style

If i have a DIV with DIV's inside it, can i specify a style on the child DIV that is dependant on the parent DIV? I want to specify a childs class based on its parents

So if i had a message DIV with posts and a forum DIV with posts i want to style the <div id="Posts"></div> based on the parents class...

-jamie

Answers: Child DIV Styles based on Partent DIVs style ( SitePoint Forums CSS )
Child DIV Styles based on Partent DIVs style

I think you want something like this:
Code:
#message #posts {
  color: red;
}
#forum #posts {
  color: navy;
}
This will make #posts different depending on whether it's in the #forum element or the #message element.

vgarcia

Previous Question:  Borders Padding in different browsers  SitePoint Forums  CSSNext Question:  CHeck this out.  SitePoint Forums  CSS

- Source: Child DIV Styles based on Partent DIVs style SitePoint Forums CSS
- Previous Question: Borders Padding in different browsers SitePoint Forums CSS
- Next Question: CHeck this out. SitePoint Forums CSS





AllQuests.com