how many main tags can be added to my html page. Is there any restriction to add more than one main tag(like one per page)?
is this correct way of using main tag??
<body>
<header></header>
<aside></aside>
<main>
<section></section>
<main>is this correct!!!</main>
</main>
<footer></footer>
There are four required tags in HTML. These are html, title, head and body. The table below shows you the opening and closing tag, a description and an example.
Definition and Usage Note: There must not be more than one <main> element in a document. The <main> element must NOT be a descendant of an <article>, <aside>, <footer>, <header>, or <nav> element.
An HTML 4.0 document generally consists of three parts: a line containing version information, a descriptive header section, and a body, which contains the document's actual content.
7.1 Introduction to the structure of an HTML documenta declarative header section (delimited by the HEAD element), a body, which contains the document's actual content. The body may be implemented by the BODY element or the FRAMESET element.
The main
element represents the main content of the body of a document or application. The main content area consists of content that is directly related to or expands upon the central topic of a document or central functionality of an application.
Authors must not include more than one main element in a document. (source)
Authors must not include the main element as a child of an article
, aside
, footer
, header
or nav
element.
here's a great article on HTML5 DOCTOR.
It should house the main content of a document or app. Its most important purpose is to "map ARIA’s landmark role main to an element in HTML."
It can’t be used as a descendant of an <article>, <aside>, <footer>, <header>, or <nav>
element.
here's an example of typical usage.
<body>
<header role="banner"></header>
<main id="content" class="group" role="main">
<!-- main content -->
</main>
<footer role="contentinfo"></footer>
</body>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With