HTML5中H2之后使用H1可以吗?
我正在查看文章 20+ 使用 HTML5 的网站的专业示例,以了解 new 的良好语义用途HTML 5 标签,我发现这个网站 http://bit.ly/bfgatc 正在使用标题中 H1
之前的 H2
。
在 HTML5 中可以吗?
I was checking the article 20+ Professional Examples of Websites Using HTML5 to see the good semantic uses of new HTML 5 tags and I found that this website http://bit.ly/bfgatc is using H2
before H1
in Header.
Is it ok in HTML5?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在我看来,这些都没有任何业务是单独的标头,并且它们绝对不应该位于
中。它们是一个标头,并且应该位于
内,甚至可能位于
中。它们没有单独的级别;只是其中一个的款式比另一个大。以任一顺序使用两者在语义上都是不正确的。
所以我建议的是,而不是:
是:
In my opinion, neither of those have any business being separate headers, and they definitely shouldn't be in an
<hgroup>
. They're one header, and should be inside a<header>
, or maybe even in a<section>
. They don't have separate levels; one's just styled bigger than the other. It's not semantically correct to use the two in either order.So what I would recommend is, instead of:
would be:
该元素已从 HTML5 (W3C) 规范中删除。正如瑞安所说。最好将其放在标签中。
The element has been removed from the HTML5 (W3C) specification. As Ryan said. It would be better to put it in a tag.
为什么不呢?
hgroup
的规范说:我似乎很清楚,例如,章节标题是 H1,副标题是 H2。
扩展一下:在这种情况下,这确实没有意义,但总的来说,这在技术上没有任何问题(尽管有点奇怪)。
Why not? The spec for
hgroup
says:It seems to clear to me that a section title would be a H1 for example, and the subtitle a H2.
To expand: In this situation, it doesn't really make sense, but in general, there is technically nothing wrong with this (although a bit weird).