Question:

The main element

Can you explain the definition of the main element? What is its goal? Are the two specifications (WHATWG and W3C) in agreement on its definition?

Answer:

The main element has two different definitions depending on the specification used.

The W3C specification describes it as the main content of the page, that is, the content that describes the main topic of a page or is the central functionality of an application. The specification also states that a document must not include more than one main element.

The WHATWG specification doesn’t assign any semantic value to the main element and describes it as a container for the dominant contents of another element. Also, according to WHATWG, you don’t have a limit in the number of times you can use the main element in a single document. If you have multiple article elements on a page, you may want to markup the main content of each article with a separate main element.


Keywords:

© 2017 QuizBucket.org