CSS selectors: more namespaces

heading level5: lime

Paragraph. Lorem ipsum dolor: white on green sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat

paragraph.Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat

Code used

/*@namespace xhtml url(http://www.w3.org/1999/xhtml);*/
xhtml|h5 span {color:lime;}
*|p span {color:#fff; background:green}
*|* .testgrid {border-color: lime; border-width: 3px} /* fails on IE 5 Win */

Notes

  1. the first selector should be ignored by a compliant UA, the namespace declaration is commented out.
  2. Known issue: *|* .testgrid recognized by IE 5 Win; browser ignores the *|*. The browser actually matches all 3 selectors.
  3. IE Mac matches the universal namespace selectors, I am not sure if this means some tentative (experimental) support or a bug.
  4. Opera 7.5: ignores the namespace and matches the first selector - this has been corrected in Opera 8.0.
  5. Konqueror 3.5.1 reads this document as text/html. The browser applies the first selector to the heading, ignores the second one and applies the third one (border on the wrapping div). See also a similar test, selectors applied to an xml (application/xml) document.

back to introduction

Last modified: September 10 2009 03:09:07 GMT.