HTML
tag (Not Supported in HTML5)

The HTML <center> is a block level element which contains both block level and inline contents within it. The content written between the <center> elements will be displayed at the middle of the page.

The <center> tag has been deprecated in HTML 4 and obsolete in HTML5.

NOTE: The <center> tag is deprecated now so instead of that you can use CSS property text-align: center; to achieve the same result.

Syntax

<center>Add Content Here....</center>  

Following are some specifications about the <center> tag

DisplayInline
Start tag/End tagBoth start and End tag
Usagetextual

Example

Using <center> tag

<!DOCTYPE html>  

<html>  

<head>  

    <title>Center tag</title>  

 </head>  

 <body>  

    <h2>Example of center tag</h2>  

    <center>This content is displayed in the middle of page, but try to use CSS property to align the content as this tag is deprecated now.</center>  

  </body>  

</html>

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *