TheDeveloperBlog.com

Home | Contact Us

C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML

HTML center Tag

HTML center Tag with html tutorial, tags, anchor, img, div, entity, textarea, marquee, p tag, heading tag, h1, h2, table, formatting, attribute, elements, ol, ul, Input Types, block element tag, inline element tag, html tags, phrase tag, head, body, form, lists, symbols etc.

<< Back to HTML

HTML <center> 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

Display Inline
Start tag/End tag Both start and End tag
Usage textual

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>
Test it Now

Using CSS

<!DOCTYPE html>
<html>
<head>
	<title>Center tag</title>
	<style >
		h2{
		 text-align: center;}
	</style>
 </head>
 <body>
      <h2>Example of center tag</h2>
      <p>This content is align centered using CSS property</p>
  </body>
</html>
Test it Now

Output:

HTML center tag

Attribute

HTML <center> tag does not contain any specific attribute in HTML but it supports the Global Attribute (till <center> tag is not removed completely).

Supporting Browsers

Elementchrome browser Chromeie browser IEfirefox browser Firefoxopera browser Operasafari browser Safari
<center>YesYesYesYesYes
Next TopicHTML cite Tag




Related Links:


Related Links

Adjectives Ado Ai Android Angular Antonyms Apache Articles Asp Autocad Automata Aws Azure Basic Binary Bitcoin Blockchain C Cassandra Change Coa Computer Control Cpp Create Creating C-Sharp Cyber Daa Data Dbms Deletion Devops Difference Discrete Es6 Ethical Examples Features Firebase Flutter Fs Git Go Hbase History Hive Hiveql How Html Idioms Insertion Installing Ios Java Joomla Js Kafka Kali Laravel Logical Machine Matlab Matrix Mongodb Mysql One Opencv Oracle Ordering Os Pandas Php Pig Pl Postgresql Powershell Prepositions Program Python React Ruby Scala Selecting Selenium Sentence Seo Sharepoint Software Spellings Spotting Spring Sql Sqlite Sqoop Svn Swift Synonyms Talend Testng Types Uml Unity Vbnet Verbal Webdriver What Wpf