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.
<!DOCTYPE html>
<html>
<body>
<center>
<h3>Welcome to GeeksforGeeks</h3>
<p>Hi Geeks</p>
</center>
</body>
</html>
Using CSS property
<!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: