Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is MDN wrong about the html main tag in their documentation?

Tags:

html

I was stumbling about the MDN documents and saw that they said it was ok to use the main tag in article elements, while W3 says it should not be a decedent at all within the article element.

MDN:

You can use multiple <main> elements within the same page when it makes sense to do so. For instance, if you have a page presenting multiple articles (each inside an <article> element,

W3:

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.

I want others to help me confirm if this is right and if so how can I contact MDN about this? I looked at their github and there is no place to report issues, or the contact us page is just about firefox, legalities of using the logo, or donating. Which is the right channel for the documentation support?

like image 816
Jonathan002 Avatar asked Dec 20 '17 17:12

Jonathan002


People also ask

Should I Use main tag HTML?

Yes, every html page should/could have the main tag. You must think this tag, as a container to show the main information.

What is the correct way to use main tag in html5?

Definition and UsageThe <main> tag specifies the main content of a document. The content inside the <main> element should be unique to the document. It should not contain any content that is repeated across documents such as sidebars, navigation links, copyright information, site logos, and search forms.

What is a main in HTML?

<main> The <main> HTML element represents the dominant content of the <body> of a document. The main content area consists of content that is directly related to or expands upon the central topic of a document, or the central functionality of an application.


1 Answers

In the top infobox on the MDN page:

Permitted parents: Any element that accepts flow content (WHATWG). However, the W3C specification doesn't allow <main> to be used as a descendent of <article>, <aside>, <footer>, <header>, or <nav>.

Basically, the W3C and WHATWG specifications disagree. Typically, the WHATWG spec is what browsers follow, though there isn't much reason to place a <main> as a descendent of one of the others listed.

like image 102
jhpratt Avatar answered Sep 28 '22 08:09

jhpratt