HTML Code for Center text

What is the <center> tag?

The <center> tag in HTML is used to center-align text or elements on a web page. It was widely used in older versions of HTML but has been deprecated in HTML5.

How to center text using HTML?

To center-align text in HTML, the <center> tag can be used as follows: <center>This text is centered</center>

Why not to use <center> tag in HTML?

The <center> tag is not recommended for use as it has been deprecated in HTML5. It's better to use CSS for text alignment and positioning.

example code

<center>This text is centered</center>

Go from files to website in seconds.

Start a free trial for 7 days — no credit card required

Get Started for Free