...

View Full Version : Applying a style to a CSS ID within an ID



Jmartini
06-11-2010, 03:28 PM
I have a site where one page has,


<div id="page123">
<div id="content"> ... </div>
</div>


How can I apply a style (from external stylesheet) to #content on only the page with id=page123 as opposed to other pages that have #content?

Thanks in Advance!

J

_Aerospace_Eng_
06-11-2010, 03:30 PM
#page123 #content {
/* styles go here */
}
Did you even try to do this on your own?

Jmartini
06-11-2010, 03:40 PM
#page123 #content {
/* styles go here */
}
Did you even try to do this on your own?

Yes, tried that. It applied the style to the #page123 div as well as all pages with #content div.

Apostropartheid
06-11-2010, 03:43 PM
Yes, tried that. It applied the style to the #page123 div as well as all pages with #content div.

You are mistaken. Either you used a comma in between the selectors or you're misinterpreting the result.

Jmartini
06-11-2010, 04:10 PM
Got it working. I must have had a typo the other times. Thanks for pushing me back to it!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum