Reputation: 75073
I'm getting a really bad end of a day as I started to change my main website to the brand new HTML5, but ...
I see HTML5 websites and everything looks fine on them, so, when I finished mine I was very pleased... well, not when I moved to a windows machine :(
under Internet Explorer, this shows absolutely nothing... I'm so revolted inside that u can't imagine, I think it has to be something simple, but I can't just find what it is ...
if a rename all HTML5 new tags into <div>
tags, the website shows but not in a central position...
I always thought that all new HTML5 tags would roll back into <div>
s ...
can anyone assist me, on what I'm doing wrong? what am I forgetting in all this? Thank you.
website works fine on IE9 Preview though, and all other browsers (Safari, Mobile Safari, FF, Opera, Chrome, etc)...
:-(
P.S. this is a question from a really desperate fellow!
Upvotes: 1
Views: 534
Reputation: 1074108
IE doesn't let you style new tags unless you tell it about them, try the HTML5 shim. Basically, IE ignores any styling information for tags it doesn't know, but if you just create an element once via JavaScript:
document.createElement('section');
...even though you then throw that element away, that makes IE realize "Oh, section
is a kind of element" and it will then apply style rules. That's what the shim script does. You need to be sure to do this before the elements in question are added to the DOM (so the shim script basically has to go in head
, you can't do the put-it-at-the-bottom optimization you frequently see).
Of course, this is dependant on the user having JavaScript enabled.
Upvotes: 5
Reputation: 804
Oh. The joys of web development. Here is a list of workaround for making IE recognize the new tags, as it's browser engine just ignores tags it doesn't recognize.
However, it may be easier just to take the HTML5 out and redesign it so that it works with div
s. Of course, you can also make the call to not support IE until version 9, but that is up to you.
Upvotes: 0