gpt4 book ai didi

html - 标记( block )引用作者的正确方法是什么?

转载 作者:搜寻专家 更新时间:2023-10-31 08:32:42 24 4
gpt4 key购买 nike

我正在尝试找出为报价添加署名的正确方法。

互联网似乎对正确的方式存在分歧。

Html5Doctor说如下:

<blockquote>
<p>A quote...</p>
<footer>
<a href="source of the quote">Author of the quote</a>
</footer>
</blockquote>

但他们还表示,最终发现使用页脚元素实际上无效。他们目前仍然没有提供 100% 正确的方法。

他们的最新更新是在 2012 年 2 月 14 日。没有添加更多信息。

另一种选择是替换 <footer><cite>元素,但 w3c 声明 <cite>元素应该只包含作品的标题,绝对不是作者(来源:w3c)

所以问题是:目前是否有一种正确的方法来为报价提供归属?如果是这样:它是什么?

最佳答案

It seems the internet is divided about the correct way.

直到 2014 年,W3CWHATWG似乎同意以下内容:

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.

对于 cite 元素:

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, the span element can be used.)

提到的其余示例使用了其他元素,例如 citefigcaption,但所有这些示例都表明这些元素被放置在外面 有问题的 blockquote 元素。

然而,自 2014 年以来,W3C HTML5 再次更改为与 HTML 4 匹配,允许使用 cite 在 block 引用中标记作者姓名。 WHATWG HTML 中的文本保持不变,因此现在不仅互联网的其余部分对此存在分歧,而且两个标准机构也是如此。但也许最有趣的是,WHATWG HTML(以及 2014 年之前的 W3C HTML5)中的定义实际上与 HTML 3.2 的定义相匹配。 ,即使当前的 W3C HTML5 定义与 HTML 4 相匹配。

话又说回来,既然 HTML 4 是每个人都熟悉的 HTML 的主流版本,也许只坚持其更宽松的定义就可以了。

关于html - 标记( block )引用作者的正确方法是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19429899/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com