Why FIrefox doesn't recognize <section>?

落爺英雄遲暮 提交于 2019-12-11 23:39:10

问题


I would just like to confirm if Firefox can't interpret <section> tag? I created a website and tested it on Chrome and Safari. Everything was fine until I tested it on firefox and it was horrible. It took me almost 2 days just to figure out that Firefox cant handle <section> tag. I would just like to confirm because I am not sure about it.


回答1:


Adding article { display: block; } to your style sheet. FF is probably treating it as an inline element because it's not fully supported.

I've used HTML5 to build a test system and it's worked fine on all browsers with a few tweaks.

EDIT

This is a script I wrote to test out some web scraping : http://randomcoding.com/steam/ I used HTML5 as the markup to see what all the fuss was about.

As you can see from the stylesheet, I've made some elements block items

/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure, 
footer, header, hgroup, menu, nav, section {
    display: block;
}

This method works for me on most browsers I checked (Chrome, Opera 10, FF3-4, IE8-9).

However, if you're starting out, I recommend you have a look at HTML5 Boilerplate : http://html5boilerplate.com/

It's got the best practices for when using HTML5 to markup your site. A good place to start.




回答2:


Take a read at HTML5 tags not working at all in firefox 3.6.3




回答3:


Firefox has no problem with the <section> tag, but Internet Explorer has.



来源:https://stackoverflow.com/questions/5469355/why-firefox-doesnt-recognize-section

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!