<blockquote>
<blockquote> 元素用来标记那些会占用一整段比较长的引用。注意下面的例子中的 <p> 元素也被包含在 <blockquote> 元素中。
代码部分
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>引用</title></head>
<body> <blockquote cite="http://www.baidu.com"> <p>Did you ever stop to think, and forget to start again?</p> </blockquote> <p>Did you ever stop to think, and forget to start again?</p></body></html>
复制代码
效果展示
浏览器通常会对 <blockquote> 元素中的内容进行缩进,尽管如此,你不能只是用 <blockquote> 元素来缩进一段文本——而应该用 CSS 来完成缩进效果。
<q />
<q> 元素用来标记位于段落中较短引用。按照惯例,浏览器理应在 <q> 元素的两侧添加引号,可是 IE 浏览器却不支持——因此许多人都回避使用 <q> 元素。
代码部分
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>引用</title></head>
<body> <blockquote cite="http://www.baidu.com"> <p>Did you ever stop to think, and forget to start again?</p> </blockquote> <p>Did you ever stop to think, and forget to start again?</p> <p> As A.A Milne said, <q>Some people talk to animals. Not many listen though That's the problem.</q> </p></body></html>
复制代码
效果展示
这两个元素都可以用 cite 特性来表示引用的来源。cite 特性的值应当是一个 URL ,该 URL 中包含有关引用来源的更详细信息。
评论