国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > HTML > 正文

blockquote標(biāo)簽

2024-08-26 00:08:56
字體:
供稿:網(wǎng)友

關(guān)于語義化,不是一句兩句就能說明白的,而且現(xiàn)在也沒有一個官方的很嚴格的定義。關(guān)于<blockquote>沒有爭議的是:

1.引用一段較長的文字

2.可以使用cite標(biāo)簽或者屬性

問題是<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 -- >

這兩個便簽指名包含的內(nèi)容為引用文字. 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>
http://www.456bereastreet.com/lab/developing_with_web_standards/structure/

這篇文章是應(yīng)用web標(biāo)準進行開發(fā),里面提到了關(guān)于一些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

這篇文章是關(guān)于transitional-vs-strict,過渡型和標(biāo)準型xhtml的區(qū)別,里面提到了內(nèi)容模型的區(qū)別,有關(guān)于<blockquote>的內(nèi)容,在strict中,引用的內(nèi)容必須使用塊級元素將其包含,通常是<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型文檔更嚴格,也算是向后兼容了。

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 禄劝| 旬邑县| 屯昌县| 北安市| 元朗区| 中山市| 方山县| 虞城县| 玛曲县| 松阳县| 光山县| 莱州市| 兴城市| 万盛区| 新竹县| 西乌珠穆沁旗| 苏尼特左旗| 南投县| 乐东| 元朗区| 郑州市| 芜湖县| 六枝特区| 包头市| 金溪县| 岢岚县| 凤山县| 大石桥市| 靖边县| 肇州县| 嘉义市| 呼图壁县| 诸城市| 中牟县| 休宁县| 丹阳市| 二手房| 通渭县| 永安市| 陵水| 华安县|