IE not styling HTML5 tags (with shiv)

后端 未结 3 1572
有刺的猬
有刺的猬 2020-12-09 11:28

I\'m trying to style a

and it\'s not working in IE. I\'m using Modernizr, but i\'ve tried the shiv by itself.

Example code



        
3条回答
  •  余生分开走
    2020-12-09 11:47

    With IE, even with the shiv, you need to declare the HTML 5 elements as block elements. I use this line for Internet Explorer, but you can modify it for the elements you need.

    header,nav,article,footer,section,aside,figure,figcaption{display:block}
    

    From the Modernizr Documentation:

    You’ll also probably want to set many of these elements to display:block;

提交回复
热议问题