HTML Tag Reference - HTML tag <center>








The <center> element align text to center.

Browser compatibility

<center> Yes Yes Yes Yes Yes

What's new in HTML5

The <center> tag is deprecated in HTML5. Use CSS instead.

Example

<!DOCTYPE html>
<html>
<body>
<!--from   w  w w  . j a  v a 2 s  .  co m-->
    <p>This is some text.</p>
    <center>This text will be center-aligned.</center>
    <p>This is some text.</p>

</body>
</html>

Click to view the demo