注册本站  论坛  繁體中文

电脑技巧
手机 | MP3 | MP4 | 显卡 | 主板 | 显示器 | 光存储 | 笔记本 | 网络设备 | 移动存储 | 数码相机
键鼠 | CPU | 音箱 | GPS | 电视 | 服务器 | 投影机 | 机箱电源 | 品牌电脑 | 办公打印 |
| 网站首页 | Cisco | Windows | Linux | Java | Dotnet | Oracle | 网页设计 | 平面设计 | 安全 | 软件应用 | 电脑维修 | 办公维修 |
您现在的位置: 电脑技巧 >> 网页设计 >> Dreamweaver >> 基础教程 >> 网页设计正文

blockquote标签应该怎样使用?

文章来源:中国设计秀www.cnwebshow.com 作者:佚名 更新时间:2007-10-13 【 】 【加入收藏

关于语义化,不是一句两句就能说明白的,而且现在也没有一个官方的很严格的定义。关于<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>
http://www.456bereastreet.com/lab/developing_with_web_standards/structure/

这篇文章是应用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型文档更严格,也算是向后兼容了。

  • 上一篇网页设计:

  • 下一篇网页设计:
  • 最 新 热 门
     Flash教程:if条件语句的用法
     Flash教程:测试AS代码的执行速度
     Flash教程:trace()的使用
     实现在AJAX下的前进、后退功能
     创建吸引访问者的网站内容的14种方法
     LBS功能:图片的自适应实现代码
     LBS增加引用地址和永久地址点击复制功能
     学习CSS布局网页的一些实例
     CSS学习者:2008年不要作浮躁的人
     网页设计制作之改进超级链接效果
    最 新 推 荐
     玩转Dreamweaver-CSS属性
     玩转 Dreamweaver速记 CSS 属性
     举例熟悉网页的头部信息表示涵义
     网页WEB字体,CSS如何控制?
     用HTML和CSS写出漂亮正规的BLOG
     blockquote标签应该怎样使用?
     解决缩小图标变样问题
     未知高度的非表格垂直对齐
     样式表CSS中div、span和center元素
     用CSS来控制网页背景解说
    相 关 文 章

    给z-blog博客添加链接点击统计
    修改z-blog分页页码样式
    给zblog加上运行代码功能
    Web标准:关于DOCTYPE
    关于blog系统中最合适做优化的程序
    Opera下cloneNode的bug
    CSS:用overflow代替left截取指定长度字符串
    PDF、ZIP、DOC链接的标注(CSS技巧)
    XHTML+CSS写出正规的BLOG
    Flash片头加载完美的loading的制作

    | 设为首页 | 加入收藏 | 联系站长 | 友情链接 | 版权申明 | 网站公告

     

    Copyright 2006-2008 pcjx.com All Rights Reserved
    电脑技巧 版权所有 粤ICP备06059145号 地图
    本网站所有内容未经许可不得转载或做其他使用