标记(块)引用的作者的正确方法是什么? [英] What is the correct way to mark up the author of a (block)quote?
问题描述
我试图找出为报价添加归因的正确方法。
似乎互联网是以正确的方式划分的。
Html5Doctor 说明如下:
< blockquote>
< p>报价...< / p>
< footer>
< a href =报价来源>报价的作者< / a>
< / footer>
< / blockquote>
但他们也声明最终发现使用页脚元素实际上并非有效。他们目前仍然没有提供100%正确的方式。
他们的最新更新于2012年2月14日。
另一个选择是将< footer>
替换为< cite>
元素,但w3c指出
所以问题是:目前是否有正确的方法来为报价提供归因?如果是这样的话:它是什么?
。截至2014年,两个 W3C 和 WHATWG 似乎同意以下内容:
报价的归因(如果有的话)必须放在
例如,这里的归属地在报价后的段落中给出:blockquote
元素之外。
< blockquote>
< p>我争辩说,我们都是无神论者。我只相信一个比你更少的
之神。当你明白为什么你拒绝所有其他
可能的神,你就会明白我为什么要解雇你。< / p>
< / blockquote>
< p> - Stephen Roberts< / p>
下面的其他示例显示了显示归因的其他方式。
blockquote>
对于
cite
元素:
一个人的名字不是作品的标题 - 即使人们称这个人为一件作品 - 因此该元素也不能用于标记人物的名字。 (在某些情况下,
b
元素可能适用于名称;例如在八卦文章中,着名人物的名字是使用不同风格呈现的关键字以引起对他们的注意。在其他情况下,如果真的需要一个元素,可以使用span
元素。)
其余的例子都使用了其他元素,例如
cite
和figcaption
,但所有这些元素都将这些元素放置在 元素的 元素之外。 >然而,自2014年以来,W3C HTML5被改为与HTML 4再次匹配,允许使用cite
标记块引用中的作者姓名。 WHATWG HTML中的文本保持不变,所以现在不仅互联网的其他部分有所分歧,而且两个标准组织也是如此。但也许最有趣的是WHATWG HTML(和2014年以前的W3C HTML5)中的定义实际上与 HTML 3.2 ,即使当前的W3C HTML5定义与HTML 4的定义相匹配。 然后,由于HTML 4是每个人都熟悉的主流版本的HTML,或许可以坚持更宽容的定义。I'm trying to figure out the correct way to add attribution for a quote.
It seems the internet is divided about the correct way.
Html5Doctor says the following:
<blockquote> <p>A quote...</p> <footer> <a href="source of the quote">Author of the quote</a> </footer> </blockquote>
But they also state that eventually the figured out that using the footer element wasn't actually valid. They currently still do not provide the 100% correct way.
Their latest update was on 2012-02-14. No further information has been added.
Another option would be to replace the
<footer>
with a<cite>
element, but w3c states that the<cite>
element should only contain a title of a work and definitely not the author (source: w3c)So the question is: Is there currently a correct way to provide attribution for a quote? And if so: what is it?
解决方案It seems the internet is divided about the correct way.
Up until 2014, both W3C and WHATWG seemed to agree on the following:
Attribution for the quotation, if any, must be placed outside the
blockquote
element.For example, here the attribution is given in a paragraph after the quote:
<blockquote> <p>I contend that we are both atheists. I just believe in one fewer god than you do. When you understand why you dismiss all the other possible gods, you will understand why I dismiss yours.</p> </blockquote> <p>— Stephen Roberts</p>
The other examples below show other ways of showing attribution.
And for the
cite
element:A person's name is not the title of a work — even if people call that person a piece of work — and the element must therefore not be used to mark up people's names. (In some cases, the
b
element might be appropriate for names; e.g. in a gossip article where the names of famous people are keywords rendered with a different style to draw attention to them. In other cases, if an element is really needed, thespan
element can be used.)The rest of the examples mentioned make use of other elements such as
cite
andfigcaption
, but all of them demonstrate these elements being placed somewhere outside theblockquote
element in question.Since 2014, however, W3C HTML5 was changed to match HTML 4 again, allowing the use of
cite
for marking up the author name in a blockquote. The text in WHATWG HTML remains unchanged, so now not only is the rest of the internet divided about it, but so are the two standards bodies. But perhaps what's most amusing about all this is that the definition in WHATWG HTML (and W3C HTML5 before 2014) actually matches that of HTML 3.2, even though the current W3C HTML5 definition matches that of HTML 4.Then again, since HTML 4 is the mainstream version of HTML that everyone is familiar with, perhaps it's OK to just stick to its more permissive definition.
这篇关于标记(块)引用的作者的正确方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!