Previous Message
Next Message

[css-d] Hiding rules from Opera using [xmlns] selector

Sent by Edwardson Tan on 31 August 2002 07:07


In one xhtml page I have links that inherit the color of the
surrounding text:

a:link
{color: inherit; text-decoration: underline;}

Neither IE nor Opera gets inherit correctly but Moz (and
NS6.x I would presume) does. Opera does weird things with
font-size: inherit so I hide inherit from it (just in case)
using the standard hide-from-Op technique:

:first-child+body a:link

I then serve non Moz browsers a different rule for the links.

But this got me thinking whether there's a simpler and less
convoluted way of hiding css rules from Op. I thought of
using attribute selectors and after some trial and error
found that the following works:

html[xmlns] /* place your selector here */

Of course this technique is only for xhtml with a namespace
attribute. Now if there are no other namespaces declared
outside the root element then the following shorthand should
suffice:

[xmlns] /* place your selector here */
{ /* declarations here hidden from IE and Opera */ }


Jigsaw is quite happy with both versions and Moz flawlessly
implements either one correctly.

So does this work for all versions of Opera? I only have
6.01/win to test it on.


-- 
Edwardson
Previous Message
Next Message