The <center> tag in HTML is used to set the alignment of text into the center. This tag is not supported in HTML5. CSS’s property is used to set the alignment of the element instead of the center tag in HTML5.
<center> Contents... </center>
Example 1: This example illustrates the HTML center tag.
Example 2: Use CSS property in HTML5 to set the text alignment into the center.
- Google Chrome
- Internet Explorer