blockquote标记应用注意

2016-02-19 12:47 8 1 收藏

有了下面这个blockquote标记应用注意教程,不懂blockquote标记应用注意的也能装懂了,赶紧get起来装逼一下吧!

【 tulaoshi.com - Web开发 】


关于语义化,不是一句两句就能说明白的,而且现在也没有一个官方的很严格的定义。关于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"PThey 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“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.”/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型文档更严格,也算是向后兼容了。

来源:https://www.tulaoshi.com/n/20160219/1601927.html

延伸阅读
标签: Web开发
点击这里返回脚本之家 HTML教程 栏目.想浏览CSS教程请点这里。 上文: 标记语言图片替换 。Chapter 15 为body指定样式 把内容与显示效果分开设定的好处之一就是灵活,通过用CSS控制网站的版面布局(在第十二章用过的方法),就能控制整个网站的设计要素,改变几条规则,就能立刻戏剧性的更新上千个页面. 用CSS控制布局的的便利性示范之一,就是为bod...
标签: Web开发
点击这里返回脚本之家 HTML教程 栏目.想浏览CSS教程请点这里。 上文: 标记语言为文字指定CSS样式 。Chapter 14 图片替换 随着更多设计师与开发者开始使用标准(特别是CSS),每天都会有许多新技术被发现,达成相同目标的新方法,更好的方法也不断发展着. "图片替换" 可以说是这种变革的最佳范例,这是用CSS把普通文字置换成图片的技术....
标签: Web开发
表单是实现动态网页的一种主要的外在形式。表单和表单域并不具有排版的能力,表单网页的制作最终还是要由表格组织起来。html表单是html页面与浏览器端实现交互的重要手段。利用表单可以收集客户端提交的有关信息。  在浏览网站时经常会遇到表单,它是网站实现互动功能的重要组成部分。无论网站使用的是那种形式的语言来实现网站的互动功...
标签: Web开发
点击这里返回脚本之家 HTML教程 栏目. 上文: 标记语言再谈清单 原文出处Chapter 9 精简标签 先前我们不断提到结构化内容能够把结构与设计细节分类并精简标签,该怎么做呢?我们可以使用符合标准的XHTML与CSS代替表格,图片制作我们所需要的版面. 使用标准技术制作网站(特别是十分依赖CSS的网站)的时候,我们常常会养成一个不太好的习惯,就是加...
标签: Web开发
点击这里返回脚本之家 HTML教程 栏目.想浏览CSS教程请点这里。 上文: 标记语言打印样式 。Chapter 12 CSS布局 本书到此为止,讨论的主要是页面内部元素,也就是内容,但是大结构怎么办?长久以来,设计者都依赖表格进行分栏布局,常常在表格之内嵌套其他表格以便达成恰巧正确的间隔,视觉效果.这些庞大的排版内容不仅下载很慢,维护起来也很费心力,...

经验教程

960

收藏

95
微博分享 QQ分享 QQ空间 手机页面 收藏网站 回到头部