HTML center - how to use <center> tag

The <center> tag is no longer supported in HTML5. When it was supported in HTML4, it was used to center align text. Now, the text-align property of CSS can be used to align the element.

Examples:

<!--using the center tag--> <div> <center>This text will be center-aligned.</center> </div> <!--using CSS--> <div> <div style="text-align:center">This text will be center-aligned.</center> </div>