Jake McGraw wrote:
I'm pretty sure this is not a bug, how do you think user agents handle the following:

HTML:
<a href="myanchor:hover">A bad ID string</a>

CSS:
a#myanchor:hover {color:#000;}

Will the anchor be black automatically or only when a cursor hovers over it?

According to CSS2 and above, colons are reserved for defining psuedo-classes (:hover,:first-child, etc).

The document you're referencing below is a an older and broader guide of what valid HTML (as a subset of SGML) is, but does not cover the interpretation that must take place between CSS and (X)HTML documents.

- jake

Special characters with a certain meaning must be escaped with a backslash if you need to use it in a selector. Your example:

a#myanchor\:hover

would select

<a id="myanchor:hover">

http://www.w3.org/TR/CSS21/syndata.html#escaped-characters

There has been a ticket for this, but I don't know if and how this is fixed.


-- Klaus

Reply via email to