TheDeveloperBlog.com

Home | Contact Us

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

HTML main tag

HTML main tag with examples, html5, forms, input, text, anchor, image, heading, marquee, textarea, paragraph, title, quotes, code etc.

<< Back to HTML

HTML Main Tag

HTML <main> tag is used to represent the main content of the <body> tag.

The <main> tag is written within <body> tag. It is used to accurately describe the primary content of a page.

The content of the main tag is directly related to the central topic of the document.

HTML <main> is a new tag and introduced in HTML5.


Points to remember:

Author should not include more than one <main> tag within a document.

The <main> element should not used as a child of an <article>, <aside>, <header>, <footer>, or <nav> element.

HTML main tag and its sub elements can be easily styled by CSS.

HTML main tag example

<main>
 <h2>Apples</h1>
 <p>The apple is a red color pomaceous fruit of the apple tree. It is a very famous saying about apple.
  </br> "An apple in a day, keeps the Doctor away".</p>
 <article>
  <h3>Red Delicious</h3>
  <p>These bright red apples are the most common found in many supermarkets.</p>
 </article>
 <article>
 <h3>Granny Smith</h3>
 <p>These juicy, green apples make a great filling for apple pies.</p>
 </article>
</main>
Test it Now

Output:

Apples

The apple is a red color pomaceous fruit of the apple tree. It is a very famous saying about apple.
"An apple in a day, keeps the Doctor away".

Red Delicious

These bright red apples are the most common found in many supermarkets.

Granny Smith

These juicy, green apples make a great filling for apple pies.

<

/main>

The <main> tag also supports global attributes and event attributes in HTML 5.


Supporting Browsers

Elementchrome browser Chromeie browser IEfirefox browser Firefoxopera browser Operasafari browser Safari
<main>YesNoYesYesYes
Next TopicHTML map 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