In article <eE*****************@news-server.bigpond.net.au>,
"e n | c k m a" <bo*@marley.com> wrote:
<div class="menu level0 haschildren active">Front page</div>
Correct.
.menu.level0.haschildren.active { ... }
You should use:
.menu, .level0, .haschildren, .active { ... }
Note the commas.
Uhm, that's not right. You use commas to group classes, such as:
.foo { color: red; }
.bar { color: red; }
.rab { color: red; }
Equals:
.foo, .bar, .rab { color: red; }
And you use spaces when you declare their relation:
.foo { color: red; }
.foo .bar { color: green; }
.bar { color: yellow; }
Produces:
<span class='foo'>This is red <span class='bar'>This is green</span></span>
<span class='bar'>This is yellow</span>
But what I want to do is creating specific matching groups. I want to use
keywords in a selector and tie styles to combinations to them, as a typical
menu would require.
So, the menu would typically look like this:
Front page
Sub page
Sub page 2
And it's hiearchical, so it actually looks like this:
Front page
Sub page
Sub page 2
Oh, and "Front page" should have a specific look if has children, and each
should have different apparence depending on what level of the hierarchy they
are found. So, the keywords above would be:
Front page level0 active haschildren
Sub page level1 inactive nochildren
Sub page 2 level1 active nochildren
This would mean that "Sub page 2" is the active menu (and that means that the
'Front page' part is active as well. So I want to apply a specific rule to this
specific state of the menu. The CSS2.1 specification says:
"For example, the following rule matches any P element whose "class"
attribute has been assigned a list of space-separated values that includes
"pastoral" and "marine":
p.pastoral.marine { color: green }
This rule matches when class="pastoral blue aqua marine" but does not match
for class="pastoral blue"."
And this is exactly what I want to do - and it works perfectly in Safari for
Mac, but breaks horribly in IE for PC (as most CSS-related stuff do).
Which is why I am asking here if there is any way to achieve the same result as
the CSS2.1 specs specify with IE?
--
Sandman[.net]