HTML Tags

HTML <center> Tag

The <center> tag was used to horizontally center-align content in HTML.
It is deprecated in HTML5 and should be replaced by CSS styling (text-align: center;) for modern web development.

Syntax

<center>Content to be centered</center>

Attributes

AttributeDescription
NoneThe <center> tag does not have any specific attributes.

Example

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Center Tag Example</title>
</head>
<body>

<h2>Deprecated &lt;center&gt; Tag Example</h2>

<center>
  <p>This paragraph is centered using the deprecated &lt;center&gt; tag.</p>
</center>

<p>Modern alternative: use CSS <code>text-align: center;</code></p>

</body>
</html>

Output

Browser Output

The text inside the <center> tag is displayed horizontally centered in the browser.
Please use our TryIt Editor to see the visual effect.

Browser Support

Chrome
Chrome
Firefox
Firefox
Edge
Edge
Safari
Safari
Opera
Opera
IE
IE9+
✅Yes✅Yes✅Yes✅Yes✅Yes✅Yes

All major browser support <center> tag

Notes

  • The <center> tag is deprecated and may be removed in future HTML versions.
  • Use CSS text-align: center; for proper, modern web standards.
  • This tag only affects horizontal alignment of inline and block content.

Conclusion

The <center> tag was historically used for horizontal alignment but is obsolete.
Modern web design should always use CSS for centering content.

Sign In Form

User your email and password to singn in

Don’t have an account, signup here : 

HTML5 & CSS3

Tools and Tutorials

Want a Website

Want a website for your business ?

Please fill out the details below, so we can reach out to you.

Registration Form

Signup to track your record and much more.

We have sent you an email with a registration link. Please click the link to verify your email address, or enter the 6-digit OTP provided in the email.

Didn't receive the OTP. Regenerate OTP Resend