How to align text in HTML?
Use CSS style with the “text-align” property. There are three values for “text-align” property, there are left, right, and center.
Here are examples:
<style>
.center-align {
text-align: center;
}
.left-align {
text-align: left;
}
.right-align {
text-align: right;
}
</style>
<p class="center-align">Center-aligned text</p>
<p class="left-align">Left-aligned text</p>
<p class="right-align">Right-aligned text</p>