The HTML attribute is used to justify-content is the align attribute. The align attribute of <p> tag is used to justify the text on a web page. This can be done by assigning the value to the aligned attribute as justified. The justification of the text aligns the text in such a way that it occupies equal horizontal space from both the left and right margins of a web page improving its appearance.
- This attribute is applicable to various HTML elements, such as
<p>
,<img>
,<table>
, etc. - This align attribute determines the horizontal alignment of the content within its container.
- This tag is outdated in HTML5.
Note: The align attribute is deprecated in HTML5, and styles should be used via CSS for better practices.
Syntax:
<p align="justify">
Example 1:
<!DOCTYPE html>
<html>
<head>
<title>Not Justified</title>
</head>
<body>
<h3>The content is not justified</h3>
<p>
Welcome to Geeks for Geeks. It is a
computer science portal for geeks.
It contains well written, well
thought articles. We are learning
how to justify content on
a web page.
</p>
</body>
</html>