Charles Roper wrote:
I need to include the following in a class name (for use in a microformat):

class="urn:lsid:ubio.org:namebank:530114"

Which microformat? That's a URI and so a more semantic place for it is in <a href="urn:..."> or maybe <link href="urn:">.

From what I gleaned from the CSS spec, I escaped it to this:

class="urn\:lsid\:ubio\.org\:namebank\:530114"

No, you do not use selector syntax in HTML attributes. You use selector syntax in selectors.

To select a class attribute containing colons, you would using the first example above without the back slashes and then in your CSS, you would write this:

.urn\:lsid\:ubio\.org\:namebank\:530114 { color: green }

For it to work in IE6 (not sure about IE7), you need to use "\3A " (including the space) instead of "\:"

.urn\3A lsid\3A ubio\.org\3A namebank\3A 530114 { color: green; }

If you put in an href attribute where it belongs, you would use this instead:

[href=urn\:lsid\:ubio\.org\:namebank\:530114] { color: green; }

(This won't work in IE at all, even if you use "\3A")

See this test case:
http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E%0A%3Cstyle%3E%0A.urn%5C%3Alsid%5C%3Aubio%5C.org%5C%3Anamebank%5C%3A530114%20%7B%20color%3A%20green%3B%20%7D%0A%5Bhref%3D%22urn%5C%3Alsid%5C%3Aubio%5C.org%5C%3Anamebank%5C%3A530114%22%5D%20%7B%20color%3A%20green%3B%20%7D%0A%3C/style%3E%0A%3Cp%20class%3D%22urn%3Alsid%3Aubio.org%3Anamebank%3A530114%22%3EThis%20line%20should%20be%20green%3C/p%3E%0A%3Cp%3E%3Ca%20href%3D%22urn%3Alsid%3Aubio.org%3Anamebank%3A530114%22%3EThis%20link%20should%20be%20green%3C/a%3E%3C/p%3E

--
Lachlan Hunt
http://lachy.id.au/


*******************************************************************
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
*******************************************************************

Reply via email to