为什么Firefox不承认<节&GT ;? [英] Why FIrefox doesn't recognize <section>?

查看:195
本文介绍了为什么Firefox不承认<节&GT ;?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是想确认如果Firefox不能跨preT <节> 标记?我创建了一个网站,并测试它在Chrome和Safari。一切都很好,直到我测试了它在Firefox,它是太可怕了。我花了近2白天,只有弄清楚,火狐不能处理<节> 标记。我只是想确认,因为我不知道这件事。

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.

推荐答案

添加文章{显示:块; } 来样式表。 FF可能是把它当作一个内联元素,因为它不完全支持。

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

我已经使用HTML5构建的测试系统,它的正常工作在所有浏览器有一些调整。

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

修改

这是一个脚本,我写来测试一些网页刮: http://randomcoding.com/steam/我用HTML5作为标记来看看有什么大惊小怪的。

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;
}

本方法适用于我的我查(铬,歌剧10,FF3-4,IE8-9)大多数浏览器。

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

不过,如果你开始,我建议你看一下HTML5的样板: http://html5boilerplate.com/

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

它有最佳实践使用HTML5来标记你的网站时。一个良好的开端。

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

这篇关于为什么Firefox不承认&lt;节&GT ;?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆