Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML
tag

HTML
tag

Example

A section of the document will be displayed in blue:

<div style="color:#0000FF">
<h3>

This is a heading inside a div element.

h3

<

p

This is some text inside a div element.

p

div

Try it »


Browser support

Internet Explorer Firefox Opera Google Chrome Safari

All major browsers support

tag.


Tag Definition and Usage Notes

The tag defines a division or a section in an HTML document.
The tag is often used to group block-level elements so that they can be formatted with CSS.

Tips and Notes

Tip:

The element is often used together with CSS to lay out web pages.

**Note:** By default, browsers usually place

a line break before and after the element. However, you can change this by using CSS.


Differences between HTML 4.01 and HTML5

The align attribute is not supported in HTML5.

In HTML 4.01, the align attribute is deprecated.


property

property Value Description
align left
 right       

 center       

 justify | HTML5 does not support。HTML 4.01 已废弃。 Specifies 
元素中的内容的对齐方式。 |

Global Attributes

The tag supports [HTML Global Attributes](/tags/ref-standardattributes.html).

Event attribute

The tag supports [HTML Event Attributes](/tags/ref-eventattributes.html).

Related Articles

HTML Tutorial:HTML layout