How to center text in HTML?

HTMLJavascriptProgramming Scripts

The HTML <center> tag is used for centering the content enclosed with this tag.

Note − This tag is now deprecated.

Example

You can try to run the following code to center text in HTML −

<!DOCTYPE html>
<html>
   <head>
      <title>HTML center Tag</title>
   </head>
   <body>
      <center>This text is centered</center>
      <p>This is a normal text.</p>
   </body>
</html>
raja
Published on 13-Mar-2018 11:12:50
Advertisements