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

HTML p align attribute

HTML

The align attribute

HTML p Tag Reference HTML

tag

Example

A right-aligned paragraph:

The paragraph is right-aligned.

Try it »


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the align attribute.


Definition and Usage

HTML5 does not support

the align attribute. Please use CSS instead.

In HTML 4.01,

The align attribute is deprecated.

The align attribute specifies the alignment of the text in the paragraph.


Compatibility notes

In HTML 4.01,

The align attribute is deprecated; use CSS instead.

CSS syntax:

CSS example: Aligning text in a paragraph

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


Syntax

Attribute values

Value Description
left Left-align the text.
right Right-align the text.
center Center-align the text.
justify Stretch the lines so that each line has an equal width (as in newspapers and magazines).

HTML p Tag Reference HTML

tag