当前位置: 首页 > 网络学院 > 网页制作基础教程 > HTML > HTML <div>标签

HTML
HTML 介绍
HTML 元素
HTML 基本标签
HTML 格式
HTML 实体字符
HTML 链接
HTML 框架
HTML 表格
HTML 列表
HTML 表单
HTML 图片
HTML 背景
HTML 颜色
HTML 颜色值
HTML 颜色名
HTML 便条
HTML 布局
HTML 字体
HTML 4.0
HTML 样式

HTML <div>标签


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-04   浏览: 357 ::
收藏到网摘: n/a

定义以及使用方法

The <div> tag defines a division/section in a document.
<div>标签可用来定义文档中的某个区或是某个章节


Differences Between HTML and XHTML
它在HTML和XHTML中的区别

The "align" attribute of the div element was deprecated in HTML 4.01.
div元素中的"align"属性在HTML4.01中不被推荐

The "align" attribute of the div element is not supported in XHTML 1.0 Strict DTD.
在XHTML1.0严密型DTD将不支持div元素里的"align"属性。


Tips and Notes
提示与注意点

Note: Browsers usually place a line break before and after the div element.
注意:浏览器通常会在div元素的后面与前面加上换行

Tip: Use the <div> tag to group block-elements to format them with styles.
提示:可以使用样式来将<div>标签所组成的块素群进行排版


实例

代码 输出结果
This is some text <div style="color:#FF0000;">
<h4>This is a header in a div section</h4>
<p>This is a paragraph in a div section</p>
</div>
This is some text

This is a header in a div section

This is a paragraph in a div section



可选属性

DTD indicates in which DTD the attribute is allowed. S=Strict, T=Transitional, and F=Frameset.
下表中的DTD列指明了被支持的DTD属性。S=Strict(精确的),T=Transitional(传统的),F=Frameset(框架)

属性名 Value 描述 DTD
align left
right
center
justify
How to align the text in the div element. Deprecated. Use styles instead.
div元素里文字的对齐方向,不推荐,使用样式
TF

标准属性

id, class, title, style, dir, lang, xml:lang

For a full description, go to Standard Attributes.
查看完整的描述

事件属性

onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup

For a full description, go to Event Attributes.
查看完整的描述

评论 (0) All

登陆 | 还没注册?