HTML元素 - div

定义

表示一块可显示 HTML 的区域。

Specifies a container that renders HTML.

注释

此元素在 Internet Explorer 3.0 及以上版本的 HTML 中可用,在 Internet Explorer 4.0 及以上版本的脚本中可用。

此元素是块元素。

此元素需要关闭标签。

The DIV element is available in HTML as of Internet Explorer 3.0, and in script as of Internet Explorer 4.0.

This element is a block element.

This element requires a closing tag.

示例代码

下面的例子使用了两个 DIV 元素对两段文字进行了不同的对齐处理。

This example uses two DIV elements to align two sections of text differently.

<DIV>
此文本代表一段。
</DIV>
<DIV ALIGN=CENTER>
此文本代表另外一段,其中文本居中显示。
</DIV>