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