HTML <center> tag

HTML <center> tag : Definition

This tag is Not Supported in HTML5.

• The HTML <center> tag is used to set the align of text into the center.

• It means anything written inside the <center> </center> tag would be aligned with the middle of the page.

• The <center> tag is a block-level element, it means it can contain other block-level and inline elements.



<center> tag example :


<!DOCTYPE html>
<html>
  <head>
    <title>Html center tag example</title>
  </head>
  <body>
    <p>This text is default aligned.</p>
    




    <center>And This text is aligned at the middle of the section by 
    using <center> tag.</center>
  </body>
</html>

OUTPUT :


  

This text is default aligned.

And This text is aligned at the middle of the section using <center> tag.