tags:

views:

106

answers:

3

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 :(

http://balexandre.com/

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!

+4  A: 

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.

T.J. Crowder
I had no idea that I coundl't style the new tags ... I really thought that the new tags if not understood by the browser, the browser would see them as plain old `<div>`. Thank you! the Html5shim is fantastic!
balexandre
@balexandre: No worries, it's strange, isn't it? As is the solution. But such is life in web development. :-) Glad that helped.
T.J. Crowder
A: 

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 divs. Of course, you can also make the call to not support IE until version 9, but that is up to you.

huntaub
IE's engine doesn't ignore elements that it doesn't understand. It's true that it's very hit or miss about treating them as elements, though, barring the shim, but normally the *content* is displayed. Apprently the OP's stylesheet is doing something to prevent that and then re-enabling it with later styling, and since the styling isn't applied...
T.J. Crowder
Sorry about that, I left that part a bit vague. Yes, I meant that it would work with the content, but the tags themselves are ignored (and treated as generic elements).
huntaub
A: 

The site loads fine on Firefox and Chrome. I tried loading the site on IE8 and it did not work. Check this question SO

Link 1 Link 2 Link 3 Link 4 Link 5

vikramjb