HTML5 block level elements do not work in IE using HTML5Shiv or Modernizr

I have HTML5Shiv / Modernizr (I tried as in the case) and normalize, which assigns display: block HTML5 elements such as section and article .

In IE8, display: block doesn't seem to be properly attached to HTML5 elements.

I made a test console log in JavaScript to make sure it was called, and also tried to remove some of the CSS in case the limit of choice was reached, and move / reorder CSS and JS around.

Any other gotchas?

+4
source share
2 answers

The problem is resolved.

It turns out that one of the nav elements had an odd attribute xmlns = "http://www.w3.org/1999/html", which was completely placed in the html5 shiv script and did not allow it to process anything below this line.

+6
source

According to Fabrizio, the only real problem may be that you are not loading modenizr before any other scripts or HTML. It should be loaded in the head, while other scripts should be in the footer.

Perhaps download the template framework to see how all this should be done - http://html5boilerplate.com

Hello,

Dave

-1
source

Source: https://habr.com/ru/post/1436586/


All Articles