English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Reference Manual

HTML Tag Directory

HTML p align attribute

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

 HTML <p> tag

Online Example

Paragraph alignment on both sides:

<!DOCTYPE html>
<html>
<head>
<title>HTML:<p> align attribute - Basic Tutorial Website(oldtoolbag.com)</title>
</head>
<body>
<p align="right">A right-aligned paragraph.</p>
<p align="left">A left-aligned paragraph.</p>
</body>
</html>
Test to see ‹/›

Browser Compatibility

IEFirefoxOperaChromeSafari

All major browsers support the align attribute.

Definition and usage

HTML5 The <p> align attribute is not supported. Please use CSS instead.

In HTML 4.01 In which, the align attribute of <p> is deprecated.

The align attribute specifies the alignment of the text within a paragraph.

Compatibility comments

In HTML 4.01 In which, the align attribute of <p> is deprecated, please use CSS instead.

CSS Syntax: <p style="text-align:right">

CSS Example: Align text in paragraphs

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

Syntax

<p align="left|right|center|justify">

Attribute value

ValueDescription
leftLeft align text.
rightRight align text.
centerCenter align text.
justifyExtend the line, so that each line can have equal width (like in newspapers and magazines).
 HTML <p> tag