Bob Rosenberg wrote:
> Yes. Embed the correct version of the rule on the page. ID has to be 
> unique on the page so IE6 is correct in stopping on the mismatch since 
> when it finds the ID'ed tag with the wrong class on it since there can 
> not be another tag with that ID to match. While it is theoretically 
> valid to have more than one possible match, this would only be valid if 
> the rules occur in a *.css Style Sheet. In that case, at least in 
> theory, the rules could be intended to apply to different pages and 
> should thus the rules should be fully parsed. Also, again at least in 
> theory, if you rewrite the DOM text (and thus alter the class), the 
> mismatch should NOT stop the parse.

First, I originally experienced this issue using an external stylesheet, 
so that is clearly not the issue.

Second, ID has to be unique in the HTML, not within the CSS. It is 
perfectly valid to have a single ID and give that element two classes, eg:

<div id="myDiv" class="content special">Foo</div>

And also valid to style this div using:

#myDiv.content {
        border: 1px solid black;
}

#myDiv.special {
        background-color: yellow;
}

If however, you keep those same style rules and change the html to be:

<div id="myDiv" class="special">Foo</div>

  Just because #myDiv.content isn't found on the page doesn't mean that 
@myDiv.special can't exist. The browser should still follow the second rule.
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to