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

HTML div align Attribute

HTML
The align attribute

HTML div Tag Reference HTML

tag

Example

A section of the document centered:

This is some text!

Try it »


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the align attribute.


Definition and Usage

No longer supported in HTML5

the align attribute; please use CSS instead.

The align attribute is deprecated in HTML 4.01.

The align attribute specifies

the horizontal alignment of the content in the element.


Compatibility notes

No longer supported in HTML5

the align attribute; please use CSS instead.

CSS syntax:

CSS example: reducing the line height in a list

In our CSS tutorial, you can find more details about The text-align propertydetails.


Syntax

Attribute values

Value Description
left Align content to the left.
right Align the content to the right.
center Center-align content.
justify Stretch the lines so that each line has an equal length (as in newspapers and magazines).

HTML div Tag Reference HTML

tag