Correct use of Blockquote, q and cite?

2019-01-21 16:05发布

Is this the correct use of Blockquote, q and cite?

<p>
<blockquote>Type HTML in the textarea above, <q>and it will magically appear</q> in the frame below.
</blockquote>
<cite><a href="http://stackoverflow.com">refrence url</a>
</p>

Is use of Blockquote, q semantically correct? or both are presentational element , so should not be used?

7条回答
仙女界的扛把子
2楼-- · 2019-01-21 16:40

Using attributes such as the cite attribute of the blockquote or q doesn't make it easily displayable (without JS or tricky CSS) and so does not address the aim of displaying a reference link easily. It is now conforming to include cite (and/or footer) into blockquote to specify the source, either textually of through a URL, of the quote, like below :

<blockquote>
  <p>Beware of bugs in the above code; I have only proved it correct, not tried it.” </p>
  <cite><a href="http://www-cs-faculty.stanford.edu/~uno/faq.html">Donald Knuth: Notes on the van Emde Boas construction of priority deques: An instructive use of recursion, March 29th, 1977</a>
</blockquote>

Note that :

  • cases of cite that are part of the quote contents (not the source reference) are also deemed quite rare, and should be handle through a differenciating class on the relevant cite subtag)

  • Regarding q, it is indeed aimed to quote inline, but it is more likely to be used outside of blockquotes (quotes into quotes are quite rare).

查看更多
登录 后发表回答