HTML align Attribute

 Night Mode  Light Mode

 

Definitions and Usage

The align attribute is a is a global attribute. It specifies the horizontal alignment for the content of an element.

There are three values can be set for the align attribute.

  1. right : right value of the align attribute specifies that the position of the elements content should be (vertically) at the right side of the webpage.
    See the below example for understanding.
  2. center : center value of the align attribute specifies that the position of the elements content should be (vertically) in center of the webpage.
    See the below example for understanding.
  3. left : left value of the align attribute specifies that the position of the elements content should be (vertically) at the left side of the webpage.
    See the below example for understanding.
  4. justify : justify value of the align attribute specifies that each line of the text should have equal width.
    See the below example for understanding.

Example :

<h2>align="right"</h2>

<p align="right">
Made cattle blessed itself female. Midst good over. Void us appear his may gathered bring tree day light let place kind fifth Heaven they're darkness him his whales greater saw.
</p>

<h2>align="center"</h2>

<p align="center">
Made cattle blessed itself female. Midst good over. Void us appear his may gathered bring tree day light let place kind fifth Heaven they're darkness him his whales greater saw.
</p>

<h2>align="left"</h2>

<p align="left">
Made cattle blessed itself female. Midst good over. Void us appear his may gathered bring tree day light let place kind fifth Heaven they're darkness him his whales greater saw.
</p>

<h2>align="justify"</h2>

<p align="justify">
Made cattle blessed itself female. Midst good over. Void us appear his may gathered bring tree day light let place kind fifth Heaven they're darkness him his whales greater saw.
</p>
Result

align=”right”

Made cattle blessed itself female. Midst good over. Void us appear his may gathered bring tree day light let place kind fifth Heaven they’re darkness him his whales greater saw.

align=”center”

Made cattle blessed itself female. Midst good over. Void us appear his may gathered bring tree day light let place kind fifth Heaven they’re darkness him his whales greater saw.

align=”left”

Made cattle blessed itself female. Midst good over. Void us appear his may gathered bring tree day light let place kind fifth Heaven they’re darkness him his whales greater saw.

align=”justify”

Made cattle blessed itself female. Midst good over. Void us appear his may gathered bring tree day light let place kind fifth Heaven they’re darkness him his whales greater saw.

 

Here are a few tutorials for you to read next:

If you find this tutorial helpful, then please Subscribe to our YouTube Channel for video tutorials, and share this article on social media.

Was this post helpful?

Leave a Comment

Your email address will not be published. Required fields are marked *