问题描述
这是正确使用 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>
使用 Blockquote
, q
语义正确吗?或两者都是表现元素,所以不应该使用?
Is use of Blockquote
, q
semantically correct? or both are presentational element , so should not be used?
推荐答案
它们不是表示元素 - blockquote
表示块引用, q
表示内联引用, cite
表示对名称,工作,标准,URL等的引用。
Yes. They are not presentational elements — blockquote
represents a block quotation, q
represents an inline quotation, and cite
represents a reference to a name, work, standard, URL, etc.
你有一些,这是很常见的blockquote。 blockquote元素不能在段落内,在HTML4中实际需要包含段落。您的片段中的 p
和 blockquote
元素的嵌套需要反转。
You do have some validation errors that are fairly common with blockquote. A blockquote element cannot be inside a paragraph, and in HTML4 actually needs to contain paragraphs. The nesting of the p
and blockquote
elements in your fragment needs to be reversed.
blockquote
元素(也是 q
元素)可以有一个 cite
属性来指定引用来自的URI。 用户代理应该
使该链接可用于用户,并且HTML4根本不说任何东西。我将在 cite
属性中包括URI,并将其作为内联链接,因为浏览器不处理它。
The blockquote
element (also the q
element) can optionally have a cite
attribute to specify a URI where the quote came from. HTML5 says user agents should
make that link available to the user, and HTML4 doesn't say anything at all. I would include the URI both in the cite
attribute and as an inline link, since browsers don't handle it.
<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>
这篇关于正确使用Blockquote,q和cite?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!