Tutorials References Exercises Videos Menu
Free Website Get Certified Pro

HTML <center> Tag


Not Supported in HTML5.

The <center> tag was used in HTML4 to center-align text.


What to Use Instead?

Example

Center-align text (with CSS):

<html>
<head>
<style>
h1 {text-align: center;}
p {text-align: center;}
div {text-align: center;}
</style>
</head>
<body>

<h1>This is a heading</h1>
<p>This is a paragraph.</p>
<div>This is a div.</div>

</body>
</html>
Try it Yourself »