这是Blockquote、q和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>q、Blockquote的用法在语义上正确吗?或者两者都是表象元素,所以不应该使用?
发布于 2010-02-05 13:22:22
是。它们不是表示元素- blockquote表示块引用,q表示内联引用,cite表示对名称、作品、标准、网址等的引用。
你确实有一些在validation errors中很常见的blockquote。blockquote元素不能在段落内,而且在HTML4中实际上需要包含段落。片段中p和blockquote元素的嵌套需要颠倒。
blockquote元素(也可以是q元素)可以选择使用cite属性来指定引号所在的URI。HTML5 says user agents 应该让使该链接对用户可用,而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>Validate this fragment
发布于 2015-09-25 17:17:49
此页上的其他答案已过期,但问题仍然有效。
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>是一个内联元素,表示作品主体的标题。既然W3C和WHATWG现在已经同意合作,我们就有了one answer可能包含的内容:书名、电影名、电视节目名、游戏名、歌曲名、话剧名等等。
它不应该是一个URL或作者的名字。
这是一个有效的用法:
<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>发布于 2010-02-05 13:12:41
您可以认为BLOCKQUOTE类似于DIV,而Q类似于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是两个属性中的一个,它只是指向来源。
https://stackoverflow.com/questions/2205159
复制相似问题