部分与文章HTML5 [英] Section vs Article HTML5

查看:117
本文介绍了部分与文章HTML5的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个由各种部分组成的页面,例如视频,新闻馈送等。我有点困惑如何用HTML5来表示这些内容。目前,我将它们设为HTML5 < section> s,但在进一步检查时,它们看起来更正确的标签是< article> code>。任何人都可以为我阐明一些事情吗?



这些内容都不是真正意义上的博客文章或文档,因此很难看到要应用哪个元素。



干杯

编辑:我选择使用文章它似乎是我认为我的部分是无关元素的容器标签。然而,实际的标记名文章似乎相当具有误导性,尽管他们说HTML5已经在开发时更加关注web应用程序,但我发现很多标签都是以博客为中心/基于文档的。



无论如何感谢您的回答,它似乎是相当主观的。

解决方案

<听起来像你应该在< article> 标签和条目中包含中文章中的每个部分 < section> 标记。



HTML5 spec 说明(Section):


section元素代表一份文件或
申请。在这种情况下,部分是
内容的主题分组,通常带有标题。 [b]


部分的示例可以是章节,
a选项卡式对话框中的各种选项卡式页面,或编号论文部分。一个Web
网站的主页可以被分成几个部分进行介绍,
新闻项目和联系信息。


注意:鼓励作者使用article元素而不是
section元素,以便将
元素的内容联合起来。


而对于文章


文章元素代表
文档,页面,应用程序或网站中的独立组合也就是说,原则上,
是可独立分配或可重用的,例如在联合。这
可以是论坛帖子,杂志或报纸文章,博客文章,
a用户提交的评论,互动小部件或小工具,或任何
其他独立内容项目。 p>

我认为OP中所谓的sections适合文章的定义,因为我可以看到它们是可独立分发或可重用的。 HTML 5.1的最新编辑草稿(斜体):


article元素表示一个完整或自包含的
组合文档,页面,应用程序或站点,即
原则,可独立分发或可重用,例如在
联合。这可能是论坛帖子,杂志或报纸
文章,博客文章,用户提交的评论,交互式小部件
或小工具,或任何其他独立内容项目。


另外,在 1月 2013年2月


I have a page made up of various "sections" like videos, a newsfeed etc.. I am a bit confused how to represent these with HTML5. Currently I have them as HTML5 <section>s, but on further inspection it looks they the more correct tag would be <article>. Could anyone shed some light on this for me?

None of these things are blog posts or "documents" in the true sense of the word so it's kind of hard to see which element to apply.

Cheers

EDIT: I have opted to use the article tag since it seems to be a container tag for unrelated elements which I guess my "sections" are. The actual tagname article however seems to be rather misleading and although they are saying HTML5 has been developed with greater consideration for web applications, I find a lot of the tags to be more blog-centric / document based.

Anyway thanks for your answers it appears to be fairly subjective.

解决方案

Sounds like you should wrap each of the "sections" (as you call them) in <article> tags and entries in the article in <section> tags.

The HTML5 spec says (Section):

The section element represents a generic section of a document or application. A section, in this context, is a thematic grouping of content, typically with a heading. [...]

Examples of sections would be chapters, the various tabbed pages in a tabbed dialog box, or the numbered sections of a thesis. A Web site's home page could be split into sections for an introduction, news items, and contact information.

Note: Authors are encouraged to use the article element instead of the section element when it would make sense to syndicate the contents of the element.

And for Article

The article element represents a self-contained composition in a document, page, application, or site and that is, in principle, independently distributable or reusable, e.g. in syndication. This could be a forum post, a magazine or newspaper article, a blog entry, a user-submitted comment, an interactive widget or gadget, or any other independent item of content.

I think what you call "sections" in the OP fit the definition of article as I can see them being independently distributable or reusable.

Update: Some minor text changes for article in the latest editors draft for HTML 5.1 (changes in italic):

The article element represents a complete, or self-contained, composition in a document, page, application, or site and that is, in principle, independently distributable or reusable, e.g. in syndication. This could be a forum post, a magazine or newspaper article, a blog entry, a user-submitted comment, an interactive widget or gadget, or any other independent item of content.

Also, discussion on the Public HTML mailing list about article in January and February of 2013.

这篇关于部分与文章HTML5的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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