blockquote标记应用注意

所属分类: 网页制作 / HTML/Xhtml 阅读数: 1800
收藏 0 赞 0 分享

关于语义化,不是一句两句就能说明白的,而且现在也没有一个官方的很严格的定义。关于<blockquote>没有争议的是:
1.引用一段较长的文字
2.可以使用cite标签或者属性
问题是<blockquote>引用的文字必须使用块级元素将他包含吗?
首先是来自W3C的解释
9.2.2 Quotations: The BLOCKQUOTE and Q elements<!ELEMENT BLOCKQUOTE - - (%block;|SCRIPT) -- long quotation --><!ATTLIST BLOCKQUOTE %attrs;
-- %coreattrs, %i18n, %events -- cite
%URI;
#IMPLIED -- URI for source document or msg -- ><!ELEMENT Q - - (%inline;)*
-- short inline quotation --><!ATTLIST Q %attrs;
-- %coreattrs, %i18n, %events -- cite
%URI;
#IMPLIED -- URI for source document or msg -- >
这两个便签指名包含的内容为引用文字. BLOCKQUOTE 用于长文字的引用(block-level content) 而 Q 用于短文字的引用(inline content) 且不允许引用的句子不完整。
这个例子的文字来自 "The Two Towers", 作者 J.R.R. Tolkien, 最为引用文字.
<BLOCKQUOTE cite="http://www.mycom.com/tolkien/twotowers.html"><P>They went in single file, running like hounds on a strong scent,and an eager light was in their eyes. Nearly due west the broad swath of the marching Orcs tramped its ugly slot; the sweet grass of Rohan had been bruised and blackened as they passed.</P></BLOCKQUOTE>
这篇文章是应用web标准进行开发,里面提到了关于一些TAGS的语义下面摘录的是<blockquote>
For longer quotations that form one or more paragraphs, the <blockquote> element should be used. CSS can then be used to style the quotation. Note that text is not allowed directly inside a <blockquote> element – it must be contained in an element, usually a <p> element.
Example:<blockquote cite="http://www.w3.org/TR/1999/REC-html401-19991224/struct/text.html"> <p>&#8220;The following sections discuss issues surrounding the structuring of text. Elements that present text (alignment elements, font elements, style sheets, etc.) are discussed elsewhere in the specification. For information about characters, please consult the section on the document character set.&#8221;</p></blockquote>
http://24ways.org/advent/transitional-vs-strict-markup
这篇文章是关于transitional-vs-strict,过渡型和标准型xhtml的区别,里面提到了内容模型的区别,有关于<blockquote>的内容,在strict中,引用的内容必须使用块级元素将其包含,通常是<p>,<div>中。
Content model differences
An element type’s content model describes what may be contained by an instance of the element type. The most important difference in content models between Transitional and Strict is that blockquote, body, and form elements may only contain block level elements. A few examples:
text and images are not allowed immediately inside the body element, and need to be contained in a block level element like p or div
input elements must not be direct descendants of a form element
text in blockquote elements must be wrapped in a block level element like p or div
所以,我认为,在strict型必须用块级元素将引用文字包含,而在非strict型中就不必了,但是建议这样这样做,因为strict型文档更严格,也算是向后兼容了。
更多精彩内容其他人还在看

DOCTYPE 文档类型声明(网页爱好者必看)

文档类型声明与不声明,将会导致你的css或js都无法正常安装要求显示。所以好多网站都声明了文档类型。这样做有什么好处大家可以看看下面的文章。
收藏 0 赞 0 分享

纯HTML标签你熟悉多少?

HTML标签很多,可是实际上常用的却就那么十几二十个,很多标签的功能渐渐的被大家忽略了.然后,如果在适当的时候,用一用,还是能在一定程序上给我们的页面设计带来一点小小的方便的.
收藏 0 赞 0 分享

HTML元素的ID和Name属性的区别

ID就像是一个人的身份证号码,而Name就像是他的名字,ID显然是唯一的,而Name是可以重复的。
收藏 0 赞 0 分享

HTML meta的大作用

meta是用来在HTML文档中模拟HTTP协议的响应头报文。meta 标签用于网页的与中,meta 标签的用处很多。
收藏 0 赞 0 分享

HTML标签tbody的用法与说明

tbody 标签表格主体(正文)。该标签用于组合 HTML 表格的主体内容。
收藏 0 赞 0 分享

HTML 特殊字符转换表

html下特殊字符转换表
收藏 0 赞 0 分享

HTML基础 HTML的组成结构

HTML是网页主要的组成部分,基本上一个网页都是由HTML语言组成的,所以要学习网站怎样建设,必须从网页的基本语言学起。
收藏 0 赞 0 分享

HTML基础之HTML内容细则

我们在第一讲里概括了一下网页的主要框架,现在我们来详细的研究网页的内部细则
收藏 0 赞 0 分享

Shtml 精简教程

SSI有什么用? 之所以要扯到ssi,是因爲shtml--server-parsed HTML 的首字母缩略词。包含有嵌入式服务器方包含命令的 HTML 文本。在被传送给浏览器之前,服务器会对 SHTML 文档进行完全地读取、分析以及修改。
收藏 0 赞 0 分享

浅谈html table 标签

总的来说,table是个复杂的东西,关于它的主题也很多。我想简单的复习一下table。
收藏 0 赞 0 分享
查看更多