Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how many `<main>` main tag can be used in a html document / Page

Tags:

html

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>
like image 465
Manivannan Avatar asked Dec 28 '14 08:12

Manivannan


People also ask

How many main tags are there in HTML?

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.

Can we use multiple main tags in HTML?

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.

What are the 3 main parts of an HTML document?

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.

What are the 2 main sections of an HTML document?

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.


2 Answers

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.

like image 148
Naveen Setty Avatar answered Sep 30 '22 07:09

Naveen Setty


once only

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>
like image 29
Todd Avatar answered Sep 30 '22 05:09

Todd