HTML5阻止引用与作者

zan*_*ona 36 html html5 quote

嗨我看到不同的方式是否履行到了大量blockquote的HTML,但它似乎并没有明确的说明文件中我应该如何正确地格式化blockquote 比方说,一个名言和求佛它的作者,如:

在胜利中,你应该得到香槟,在失败中,你需要它.

拿破仑·波拿巴

HTML5中的正确格式是什么?

作者应该在blockquote标签内还是外?它应该在cite属性中吗?(即使知道文档指定了URI,也不知道作者)

iGE*_*GEL 44

我GOOGLE了这件事,它看起来像<figure><figcaption>应该做的工作:

<figure>
  <blockquote cite="https://developer.mozilla.org/samples/html/figure.html">
    Quotes, parts of poems can also be a part of figure.
  </blockquote>
  <figcaption>MDN editors</figcaption>
</figure>
Run Code Online (Sandbox Code Playgroud)

https://developer.mozilla.org/samples/html/figure.html

<figure>
  <blockquote cite="http://www.w3.org/html/wg/drafts/html/master/grouping-content.html#the-figure-element">
    The figure element represents some flow content, optionally with a caption,
    that is self-contained and is typically referenced as a single unit from the
    main flow of the document.
  </blockquote>
  <figcaption>asdf</figcaption>
</figure>
Run Code Online (Sandbox Code Playgroud)

http://www.w3.org/html/wg/drafts/html/master/grouping-content.html#the-figure-element


ski*_*ulk 15

这就是Bootstrap 在v3.3引用的方式.

<blockquote>
  <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
  <footer>Someone famous in <cite title="Source Title">Source Title</cite></footer>
</blockquote>
Run Code Online (Sandbox Code Playgroud)

有关MDN的页脚元素的更多信息:https://developer.mozilla.org/en-US/docs/Web/HTML/Element/footer

HTML <footer>元素表示其最近的切片内容或切片根元素(即其最近的父元素)的页脚 <article>, <aside>, <nav>, <section>, <blockquote>, <body>, <details>, <fieldset>, <figure>, <td>.页脚通常包含有关该部分的作者,版权数据或相关文档的链接的信息.

您还可以考虑使用结构化数据,例如微数据,RDFa和微格式.


小智 14

http://neilpie.co.uk/2011/12/13/html5-quote-attribution/

例如,使用

<small class="author">Napoleon Bonaparte<small>
Run Code Online (Sandbox Code Playgroud)

HTML 5文档说:"小字体通常包含免责声明,警告,法律限制或版权.小字体有时也用于归属或满足许可要求."


San*_*ues 10

更新2018年

HTML 5.3编辑草案,2018年3月9日

W3C谈到引用元素:

引用元素表示对创造性工作的引用.它必须包括作品的标题或作者的名称(人,人或组织)或URL引用,或者根据用于添加引文元数据的约定的缩写形式的引用.

所以下面的代码没问题:

<blockquote>
    Those who pass by us, do not go alone, and do not leave us alone; 
    they leave a bit of themselves, and take a little of us.
    <cite>Antoine de Saint-Exupéry</cite>
</blockquote>
Run Code Online (Sandbox Code Playgroud)