Re: New elements vs. Trident

Dean Edwards wrote:
> 
> Robert Burns wrote:
>>> For XHTML you can mark up new elements like this:
>>>
>>> <html:newelement><em>some text</em></html:newelement>
>>
>> Is that for IE? Or does that work in any browser (specifically Firefox)?
>>
> 
> It will work cross-browser if it is marked up as above.
> 
> To style the new element you have to use namespace aware CSS. 
> Annoyingly, IE requires the namespace delimiter to be escaped:
> 
> html\:newelement {
>  /* some style */
> }

IE doesn't handle XHTML, so I suppose you mean good old HTML with 
pseudo-namespaces? (If it was XML, you'd need to define that namespace 
first and use |, which is the namespace delimiter in the CSS land.) How 
do things like getElementsByTagName behave in that case? Would a 
HTML5-aware user agent recognize that element if it's prefixed?

> Cross-browser styling looks like this:
> 
> html\:newelement, newelement {
>  /* some style */
> }

The first selector should match in any browser in HTML mode, the second 
selector should match in any browser in XML mode if html is the default 
namespace in that CSS file ... so what are we talking about?

Received on Monday, 17 September 2007 00:42:06 UTC