HTML align Attribute

HTML align Attribute specifies the alignment of content of HTML Element. Mostly it was used for the text content of HTML Tag.

Syntax of HTML align Attribute

The Syntax of HTML align Attribute is shown below.

<div align="left">Text.</div>

Usage of HTML align Attribute

HTML align Attribute is used to set the alignment of the text content of HTML Tag.

HTML align Attribute was deprecated in HTML5, use CSS instead.

Used For

HTML align Attribute was used for following tags.

Tag Name
HTML div Tag
HTML p Tag
HTML col Tag
HTML colgroup Tag
HTML table Tag
HTML tbody Tag
HTML td Tag
HTML tfoot Tag
HTML th Tag
HTML thead Tag
HTML tr Tag
HTML applet Tag
HTML img Tag
HTML iframe Tag
HTML hr Tag
HTML caption Tag

Example of HTML align Attribute

Simple example of HTML align Attribute is given below.

<p align="left">This is Main Text.</p>

In above example we have used HTML align Attribute to align text content of p tag to the left.

Values of HTML align Attribute

Following values can be used with HTML align Attribute.

ValueDescription
leftAlign content to the left.
rightAlign content to the right.
centerAlign content to the center.
justifyIt makes sure that width of all lines is equal.

Browser Support for HTML align Attribute

HTML align Attribute is supported by following major browsers.

Browser NameVersion
ChromeAll
FirefoxAll
OperaAll
IE / EdgeAll
SafariAll