<aside> 与 <quote> 是否有用例
Is there a usecase for <aside> vs <quote>
我对编码比较陌生,正在研究语义 HTML5。
我刚刚看到 <aside>
标签,其中的指导性文本表明它用于引文以及其他内容,例如参考书目、脚注等。
我自己经常看到并坦率地使用 <quote>
,但现在我想知道使用 <aside>
是否会得到更广泛的接受。
这里的常见做法是什么,还是它们可以简单地互换?
HTML 中没有 quote
元素。
来自 html5doctor 对于 aside
:
Represents a section of a page consisting of content that is tangentially related to the content around the aside element, and which could be considered separate from that content. Such sections are often represented as sidebars in printed typography.
blockquote
(这就是我假设你的意思):
The blockquote element represents a section that is quoted from another source.
Content inside a blockquote must be quoted from another source, whose address, if it has one, may be cited in the cite attribute.
还有q
:
The q element represents some phrasing content quoted from another source.
不确定您的 aside
描述来自何处,但通常您从其他来源引用的任何内容,请使用 blockquote
或 q
。任何与页面上其他内容相关但不核心的内容,请使用 aside
.
我认为您正在寻找的内容已经得到解答here。简而言之,<aside>
用于与正文相关但不重要的信息,而 <q>
或引号标签用于正文中直接引用的信息,并且需要正文有意义。
为了总结为什么(而不是)应该用于引述,以下是确定您是否错误使用这些元素的方法:
如果您可以从页面中删除一个,并且与它相切的内容变得不完整,那么您不应该使用
如果您可以从页面中删除 a,并且即使没有它,它周围的内容也是完整的,那么您不应该使用
因此,仅用于引用作为主要内容一部分的外部资源,而不用于装饰性或在主要内容中重复的“副”内容。这篇文章中的两句话是合法的内容,因为没有它们,内容将不完整。
我对编码比较陌生,正在研究语义 HTML5。
我刚刚看到 <aside>
标签,其中的指导性文本表明它用于引文以及其他内容,例如参考书目、脚注等。
我自己经常看到并坦率地使用 <quote>
,但现在我想知道使用 <aside>
是否会得到更广泛的接受。
这里的常见做法是什么,还是它们可以简单地互换?
HTML 中没有 quote
元素。
来自 html5doctor 对于 aside
:
Represents a section of a page consisting of content that is tangentially related to the content around the aside element, and which could be considered separate from that content. Such sections are often represented as sidebars in printed typography.
blockquote
(这就是我假设你的意思):
The blockquote element represents a section that is quoted from another source.
Content inside a blockquote must be quoted from another source, whose address, if it has one, may be cited in the cite attribute.
还有q
:
The q element represents some phrasing content quoted from another source.
不确定您的 aside
描述来自何处,但通常您从其他来源引用的任何内容,请使用 blockquote
或 q
。任何与页面上其他内容相关但不核心的内容,请使用 aside
.
我认为您正在寻找的内容已经得到解答here。简而言之,<aside>
用于与正文相关但不重要的信息,而 <q>
或引号标签用于正文中直接引用的信息,并且需要正文有意义。
为了总结为什么(而不是)应该用于引述,以下是确定您是否错误使用这些元素的方法:
如果您可以从页面中删除一个,并且与它相切的内容变得不完整,那么您不应该使用 如果您可以从页面中删除 a,并且即使没有它,它周围的内容也是完整的,那么您不应该使用 因此,仅用于引用作为主要内容一部分的外部资源,而不用于装饰性或在主要内容中重复的“副”内容。这篇文章中的两句话是合法的内容,因为没有它们,内容将不完整。