Thomas said:
When using this idea on a-tags it works fine on the first menu level,
but if you look at this page:
http://www.jmdanmark.dk/fionia/boligtype_a.php
you can see the second levels active menuitem "Boligtype A" is bold and
the color of the text is gray. It should actually not have been bold
and the color should be more black (a described in div#menu ul li ul li
a.activey {...} in standard.css)
Instead it inherited the bold property from the div#menu ul li a.active
{...} and the color from somewhere else... how come it does not follow
the directions of the div#menu ul li ul li a.activey {...} directive?
Consider this example:
-----------------------------------
div#menu ul li a {
font-weight: bold;
}
div#menu ul li ul li a {
font-style: italic;
}
-----------------------------------
<div id="menu">
<ul>
<li><a href="#">Link 1</a></li>
<li>Hello
<ul>
<li><a href="#">Link 2</a></li>
</ul>
</li>
</ul>
</div>
-----------------------------------
"Link 1" will be in bold. "Link 2" will be in italics *and* in bold. Why?
Because *both* the stylesheet rules apply to it.
If we want "Link 2" to be in non-bold italics, we need to explicitly tell
it not to use bold:
-----------------------------------
div#menu ul li a {
font-weight: bold;
}
div#menu ul li ul li a {
font-style: italic;
font-weight: normal;
}
-----------------------------------
The reason for this is that for example "div p" does not mean "any
paragraph that is *directly* inside a div", like:
<div><p>...</p></div>
It includes *indirect* children too, such as:
Ok... Why is this? What should the difference be?
Again it is about semantics. <b> means "I want this text to be bold".
I did not know this. I have never seen any problems. Can you give an
example of the problem... Quirks mode?
Details of IE6/Win's quirks mode are here:
http://msdn.microsoft.com/library/en-us/dnie60/html/cssenhancements.asp#cssenhancements_topic2
Various browsers (Opera 7, IE6/Win, IE5/Mac, Mozilla, Netscape 6.2+, etc)
have something called "quirks mode" where they emulate some of IE5/Win's
CSS bugs.
If you include the <?xml ... ?> bit, IE6/Win will automatically enter
quirks mode and start doing buggy CSS.