这是正确使用 Blockquote, qcite?

<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>

是的使用 Blockquote, q 语义上正确的吗?或两者都是表象的元素,因此不应使用?

有帮助吗?

解决方案

是。它们不是表现性元素 - blockquote表示块报价,q表示一个内联的报价,并cite表示到姓名,工作,标准,URL等的参考

您确实有一些验证错误是与块引用相当普遍。甲BLOCKQUOTE元件不能是段内,并在实际上HTML4需要包含段落。需要扭转在片段的pblockquote元素的嵌套。

blockquote元件(也是q元件)可任选地具有cite属性来指定一个URI,其中引用来自。 HTML5说用户代理作出这样的链接提供给用户,而HTML4不说任何事情。我将包括URI两者在cite属性和作为内联链接,因为浏览器不处理它。

这是我会怎么写片段,在考虑到这些修正:

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

验证该片段

其他提示

此页面上的其他的答案都过时了,但问题仍然是有效的。

q元素是内嵌元件,应当这样使用像(即在其内部没有块元素。):

<p>
   In the words of <cite>Charles Bukowski</cite> -  
   <q>An intellectual says a simple thing in a hard way. 
   An artist says a hard thing in a simple way.</q>
</p>

又如:

<p>
    <q>This is correct, said Hillary.</q> is a quote from the 
    popular daytime TV drama <cite>When Ian became Hillary</cite>.
</p> 

q元件不应该被放置在blockquote元件的内部,因为这将是多余的 - 两者都表示报价。

一个blockquote是块元素,允许其他的块元素可以放在里面:

  <blockquote>
    <p>My favorite book is <cite>At Swim-Two-Birds</cite>.</p>
    - <cite>Mike Smith</cite>
  </blockquote>

<cite>稍微复杂一些。这是一个内联元素,但它取决于你在哪个以下HTML规范。该 W3C 说,它可能含有一个网址,一个工作(如书名,电影标题等)的标题,或作者姓名。

WHATWG 指出它可能只包含一个URL或作品的标题,等等的的一个人的名字。

这是一个有效的WHATWG用法:

<figure>
 <blockquote>
  <p>The truth may be puzzling. It may take some work to grapple with.
  It may be counterintuitive. It may contradict deeply held
  prejudices. It may not be consonant with what we desperately want to
  be true. But our preferences do not determine what's true.</p>
 </blockquote>
 <figcaption>Carl Sagan, in "<cite>Wonder and Skepticism</cite>", from
 the <cite>Skeptical Inquirer</cite> Volume 19, Issue 1 (January-February
 1995)</figcaption>
</figure>

您可以考虑BLOCKQUOTE类似于一个DIVQ类似于SPAN

推荐的用法是括在BLOCKQUOTE和小,单线或句子引号大引号Q

<blockquote>
    <p>This is a big quote.</p>
    <p>This is the second paragraph with a smaller <q>quote</q> inside</p>
</blockquote>

引用是在任一个属性,它仅仅指向源。

使用的属性,例如 cite 属性的 blockquoteq 不让它很容易显示(无JS或棘手的CSS)和所以不能解决的目的是显示一个参考链路容易。 它现在是符合的 包括 cite (和/或 footer) blockquote 指定的来源,无论是文字上的,通过一个网址,该报价的,如下:

<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>

注意:

  • cite 这是报价内容(未来源的参考),也被视为相当罕见的,并应处理通过一个differenciating类相关的 cite 子标记)

  • 关于 q, 它确实是旨在引用内联,但它更有可能被用外引用文字(报价到的报价是相当罕见的).

根据时, “引用” 是一个的属性问的 - 并在该不能很好地支持

语义(合法的)使用<cite>元素仍在即使的辩论“在HTML5中,该元素的使用,以纪念一个人的名字不再被认为是语义上合适的。”

您会发现关于“<blockquote><q><cite>”这里非常详细的和有用的文章:

http://html5doctor.com/blockquote-q-cite/

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top