开发者

Nav Bar is not rendering properly in IE

开发者 https://www.devze.com 2023-03-16 00:36 出处:网络
I\'m relatively new with css, but was having an issue trying to accommodate all of the browsers, not surp开发者_运维技巧risingly in this case, IE.

I'm relatively new with css, but was having an issue trying to accommodate all of the browsers, not surp开发者_运维技巧risingly in this case, IE.

Here is my issue recreated on JSfiddle : http://jsfiddle.net/AgdGs/3/

In IE, the main problem is that the nav bar doesn't stay styled and will move below the logo.

I think this is a relatively easy fix, I just haven't been able to find the answer anywhere.

Thanks in advance for the help and let me know if you need any more info.


Versions of IE lower than 9 do not natively recognize the HTML5 semantic elements such as <header> and <nav>.

You need this in your <head>: http://code.google.com/p/html5shiv/

<!--[if lt IE 9]>
<script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

You will also need to set the HTML5 elements to display: block:

article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
    display: block;
}

Comprehensive information here: http://paulirish.com/2011/the-history-of-the-html5-shiv/


<nav> is HTML5 element, and only supported in latest browsers not older browsers, below IE 9


As you can see in IE developer tools (I've tested this in IE8, you didn't mention what version you tested it in), the UL is moved outside the nav element.

0

精彩评论

暂无评论...
验证码 换一张
取 消