Why isn't Modernizr working for me?

后端 未结 2 1509
自闭症患者
自闭症患者 2020-12-10 08:23

I don\'t think modernizr likes me, can someone please tell me what i\'m doing wrong. I can\'t seem to get modernizr to work on firefox, ie etc... I\'m only using elements li

2条回答
  •  执笔经年
    2020-12-10 09:10

    You probably are forgetting to style the new HTML5 elements as block-level elements. By default, browsers treat any unknown element as an inline element (display:inline) which makes it difficult to do much with them.

    Newer browsers are slowly treating the new HTML5 elements as stable, meaning they start giving them default styling like display:block for the header element, for instance. But, most browsers on the market today don’t have those default styles for HTML5 elements, so you’ll need to provide them.

    Here’s a quick sample bit of CSS to do that:

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

    Adding that CSS to your main.css should fix your styling issue.

提交回复
热议问题