/

HTML / CSS / JavaScript Tutorial

HTML Element: <main>

[this page | pdf | back links]

The HTML <main> element indicates the main content of a document. It is new in HTML 5. Content within the element should ideally be unique to the document and hence should not include material such as sidebars, copyright information, logos and search forms.

 

There shouldn’t be more than one <main> element in a document and it shouldn’t be a descendent of an <article>, <aside>, <footer>, <header> or <nav> element.

 

The attributes it can take are HTML global attributes and HTML event attributes.

 

To create or access such an element in JavaScript see here. The corresponding HTML DOM object supports standard DOM properties and methods. The default style applicable to this element is shown here.

 


NAVIGATION LINKS
Contents | Prev | Next | HTML Elements


Desktop view | Switch to Mobile