Definition and Usage The align attribute specifies horizontal alignment of the content of the div element. Compatibility Notes The align a...
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">
Syntax
<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.Example
Source | Output |
---|---|
<div align="right"> <p>Hello World</p> </div> | Hello World |