The Wayback Machine - https://web.archive.org/web/20230724161048/https://www.geeksforgeeks.org/html-p-align-attribute/
Skip to content
Related Articles
Open In App

Related Articles

HTML | <p> align Attribute

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

The HTML <p> align Attribute is used to specify the alignment of paragraph text content.

Syntax:

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

Attribute Values:

  • left: It sets the text left-align. It is a default value.
  • right: It sets the text right-align.
  • center: It sets the text center-align.
  • justify: It stretch the text of paragraph to set the width of all lines equal.

Note: The <p> align attribute is not supported by HTML 5.

Example:




<!DOCTYPE html>
<html>
  
<head>
    <title>
        HTML p align Attribute
    </title>
</head>
  
<body>
    <h1>GeeksforGeeks</h1>
  
    <h2>HTML p align Attribute</h2>
  
    <p align="left">
      Left align content
  </p>
    <p align="center">
      center align content
  </p>
    <p align="right">
      Right align content
  </p>
</body>
  
</html>

Output:

Supported Browsers: The browser supported by HTML <p> align attribute are listed below:

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Safari
  • Opera

HTML is the foundation of webpages, is used for webpage development by structuring websites and web apps.You can learn HTML from the ground up by following this HTML Tutorial and HTML Examples.

Last Updated : 22 Feb, 2022
Like Article
Save Article
Similar Reads
Related Tutorials