What's new? | Help | Directory | Sign in
Google
             
Search
for
Updated Nov 15, 2008 by pilgrim
Labels: about-css, is-tip, from-microsoft
MakeIEStyleUnknownElements  

Introduction

IE doesn't apply CSS to elements which it doesn't know about.

Details

document.createElement("nav");

After this JS line is executed, IE applies CSS to

<nav>
</nav>
element.

Note: I don't know if this element shows up in the DOM.

External links

Comment by Sjoerd Visscher describing this trick


Comment by vbaspcppguy, Jul 19, 2008

That element would not be in the DOM. You would have to add it as a child to an existing element first.

As far as I know that actual element would cease to exist when the code block exits.

Comment by bradneuberg, Nov 25, 2008

Also note that nested custom elements won't work correctly using this technique. In order to support nested custom elements you have to delve into using Microsoft Behaviors.


Sign in to add a comment