The
text-align: center CSS property use to align the text in the center. After using the text-align: center property the focus on the center position of the HTML element where we apply text-align: center property
Example of text-align: center
<p style ="text-align: center">This is a paragraph with text-align: center property.</p>
Result:
This is a paragraph with text-align: center property.
Example of text-align: left
<p style ="text-align: left">This is a paragraph with text-align: center property.</p>
Result:
This is a paragraph with text-align: center property.
Example of text-align: right
<p style ="text-align: right">This is a paragraph with text-align: center property.</p>
Result:
This is a paragraph with text-align: center property.