HTML <main> tag

You are Here:

HTML <main> tag

The <main> tag defines the main content of the <body> of a document.

Note: The content inside the <main> tag should be unique and is directly related to or expands upon the central topic of a document.

Warning: Content that is repeated across a set of documents or document sections such as copyright information, logos, navigation links, sidebars, and search forms shouldn't be included unless the search form is the main function of the page.

Example

HTML Online Editor
<!DOCTYPE html> <html> <body> <main> <h1>Programming Language</h1> <p>C, Python and Node.js are the most popular programming language in todays world</p> <article> <h1>C</h1> <p>C is a general-purpose, imperative computer programming language designed by Dennis Ritchie.</p> </article> <article> <h1>Python</h1> <p>Python is an interpreted, object-oriented, high-level programming language designed by Guido van Rossum.</p> </article> <article> <h1>Node.js</h1> <p>Node.js is an open-source, cross-platform JavaScript run-time server side programming language designed by Joyent.</p> </article> </main> </body> </html>

Attributes

There is no special attributes for <main> tag. Only Global attributes.

Reminder

Hi Developers, we almost covered 99.5% of HTML Tutorials with examples for quick and easy learning.

We are working to cover every Single Concept in HTML.

Please do google search for:

Join Our Channel

Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.

This channel is primarily useful for Full Stack Web Developer.

Share this Page

Meet the Author