HTML main Tag

HTML main Tag is just a container which is used for the most important or main content of the website or web page. Always use only one main tag on a page.

Syntax of HTML main Tag

The Syntax of HTML main Tag is shown below, It has both starting tag and ending tag.

<main>
</main>

Usage of HTML main Tag

HTML main Tag is used as a container for the main and unique content of the website. The main tag cannot contain any type of content which is repeatedly used in html document.

HTML main Tag cannot contain another main tag.

HTML main Tag cannot be used inside other tags like nav tag, aside tag, article tag, header tag or footer tag.

HTML main Tag is a block level element.

Example of HTML main Tag

Simple example of HTML main Tag is given below.

<main>
    <h1>Web Languages</h1>
    <div>
     <h1>HTML</h1>
     <p>HTML is a markup language.</p>
    </div>
    
    <div>
     <h1>CSS</h1>
     <p>CSS is a style sheet language.</p>
    </div>
    
    <div>
     <h1>JavaScript</h1>
     <p>JavaScript is a client side programming language.</p>
    </div>
</main>

In above example we have used main tag for our main content which is unique and important.

Browser Support for HTML main Tag

HTML main Tag is supported by higher versions of latest browsers like Chrome (26), Firefox (21), Edge (12), Opera (16) and more.

Global Attributes Support in HTML main Tag

The HTML main Tag supports all Global Attributes.

Event Attributes Support in HTML main Tag

The HTML main Tag supports all Event Attributes.

HTML main Tag Video

Watch our video on HTML main Tag.

HTML anchor Tag HTML abbr Tag HTML acronym Tag HTML address Tag HTML applet Tag HTML area Tag HTML article Tag HTML aside Tag HTML audio Tag HTML b Tag HTML base Tag HTML basefont Tag HTML bdi Tag HTML bdo Tag HTML big Tag HTML blockquote Tag HTML body Tag HTML br Tag HTML Button Tag HTML Canvas Tag HTML Caption Tag HTML Center Tag HTML Cite Tag HTML Code Tag HTML Col Tag HTML colgroup Tag HTML comment Tag HTML data Tag HTML datalist Tag HTML dd Tag HTML del Tag HTML details Tag HTML dfn Tag HTML dialog Tag HTML dir Tag HTML div Tag HTML dl Tag HTML Doctype Tag HTML dt Tag HTML em Tag HTML embed Tag HTML fieldset Tag HTML figcaption Tag HTML figure Tag HTML font Tag HTML footer Tag HTML form Tag HTML frame Tag HTML frameset Tag HTML Heading Tags HTML head Tag HTML header Tag HTML hr Tag HTML html Tag HTML i Tag HTML iframe Tag HTML img Tag HTML input Tag HTML ins Tag HTML kbd Tag HTML label Tag HTML legend Tag HTML li Tag HTML link Tag HTML main Tag HTML map Tag HTML mark Tag HTML meta Tag HTML meter Tag HTML nav Tag HTML noframes Tag HTML noscript Tag HTML object Tag HTML ol Tag HTML optgroup Tag HTML option Tag HTML output Tag HTML p Tag HTML param Tag HTML picture Tag HTML pre Tag HTML progress Tag HTML q Tag HTML rp Tag HTML rt Tag HTML ruby Tag HTML s Tag