Open In App

HTML <center> Tag

Last Updated : 11 Jul, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

The <center> tag in HTML was used to horizontally center content on a webpage. However, it is deprecated in HTML5 and should no longer be used. Alternatively, we will use the text-align property.

HTML
<!DOCTYPE html>
<html>

<body>
    <center>
        <h3>Welcome to GeeksforGeeks</h3>
        <p>Hi Geeks</p>
    </center>

</body>

</html>

Using CSS property

HTML
<!DOCTYPE html>
<html>

<body>
    <h3 style="text-align: center">
      welcome to GeeksforGeeks
  	</h3>
    <p style="text-align: center">
        hi geeks
    </p>
</body>

</html>


Related Article:


HTML <center> Tag

Similar Reads