Easy Tutorial
❮ Att A Download Att Source Type ❯

HTML <div> align Attribute

HTML <div> Tag

Example

A section in the document centered:


Browser Support

All major browsers support the align attribute.


Definition and Usage

The align attribute of <div> is deprecated in HTML 4.01.

The align attribute specifies the horizontal alignment of content within the <div> element.


Compatibility Notes

The <div> align attribute is no longer supported in HTML5; use CSS instead.

CSS syntax: <div style="text-align:center">

CSS Example: Reduce Line Height in Lists

In our CSS tutorial, you can find more details about the text-align property.


Syntax

Attribute Values

Value Description
left Left-aligns the content.
right Right-aligns the content.
center Centers the content.
justify Stretches the lines so that each line has equal width (like in newspapers and magazines).
❮ Att A Download Att Source Type ❯