In HTML, you can use the text-align attribute to align text. Set the "text-align:center" style to the text to align it horizontally in the center, and set "text-align:right" to align it horizontally to the right. Set "text-align:justify" to align both ends.
The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.
In HTML, you can use the text-align attribute to align text.
text-align:center
Specify element text to be aligned horizontally in the center.
text-align:right
Specifies the horizontal right alignment of element text.
text-align:justify
Specifies that the text of the element is aligned at both ends.
Recommended tutorial: "html video tutorial"
The above is the detailed content of How to align text in html. For more information, please follow other related articles on the PHP Chinese website!