HighDots Forums  

Quickie # Is it possible to have child Class under ID ?

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss Quickie # Is it possible to have child Class under ID ? in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Steve Kostecke
 
Posts: n/a

Default Quickie # Is it possible to have child Class under ID ? - 08-21-2006 , 11:35 AM






Say I have a <div id="content"> for the main content column, and within
that column, I have several items, ie <div class="item"> (each would be
some sort of article of sorts.)

In the CSS say I have #content { ... }

Why is it I cannot have #content.item { ... } as this seems to fail on
any browser I've tried (IE 6, FF 1.5, Moz 1.8b, NS 7, Opera 8), but I do
seem to recall that this was possible but I can't find the correct
syntax for this particular construct.

Thanks for any help.



Reply With Quote
  #2  
Old   
Spartanicus
 
Posts: n/a

Default Re: Quickie # Is it possible to have child Class under ID ? - 08-21-2006 , 12:36 PM






"Steve Kostecke" <spamtrap (AT) ntp (DOT) isc.org> wrote:

Quote:
Say I have a <div id="content"> for the main content column
Please do not multi post, see alt.html for answers.

--
Spartanicus


Reply With Quote
  #3  
Old   
VidTheKid
 
Posts: n/a

Default Re: Quickie # Is it possible to have child Class under ID ? - 08-26-2006 , 10:33 AM



Steve Kostecke wrote:
Quote:
Say I have a <div id="content"> for the main content column, and within
that column, I have several items, ie <div class="item"> (each would be
some sort of article of sorts.)

In the CSS say I have #content { ... }

Why is it I cannot have #content.item { ... } as this seems to fail on
any browser I've tried (IE 6, FF 1.5, Moz 1.8b, NS 7, Opera 8), but I do
seem to recall that this was possible but I can't find the correct
syntax for this particular construct.
#content.item { ... } would apply to an element that has *both*
id="content" and class="item". Since the class "item" is not applied
to the div with id="content" but a child (more generally, descendant)
of it, your CSS selector should look more like this:
#content .item { ... }
You were close, you just forgot a whitespace.

--
Vid the Kid



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.