HTML Text alignment is used to align the text on the web page (like left, right, center etc.).
HTML Text Alignment is defined by style="text-align:value;" syntax.
Value can be (left, right or center).
It can be used with any HTML element inside Opening tag.
In the above, we have shown an example of HTML Center Text Alignment.
Center attribute align the text on the center of the Web page.
It helps to align the heading on the center which gives the better look of heading on Web Page.
Run the code to see the effect.
In the above, we have shown an example of HTML Center Text Alignment.
Right attribute aligns the text on the right of the Web page.
It is a very rare attribute which is used in HTML language.
Run the code to see the effect.