HTML div align Attribute

Definition and Usage

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

Compatibility Notes

The align attribute of the div element was deprecated in HTML 4.01 and is not supported in XHTML 1.0 Strict DTD.
Use CSS instead.
CSS syntax: <div style="text-align:right">


<div align="align">

Syntax Example

<div align="center">

Attribute Values

Value Description
left Text is left-aligned.
right Text is right-aligned.
center Text is center-aligned.
justify Text is justified.

Browser Support

The attribute is deprecated, but still supported in all major browsers.


Source Output
<div align="right">
<p>Hello World</p>
Hello World
HTML div align Attribute Reviewed by 1000sourcecodes on 05:05 Rating: 5
Powered by Blogger.