How do I mark up a page with more than one main-content candidate?
Quick answer
Choose the one region that contains the page’s dominant content or central application function, and mark that region as <main>. If several regions seem plausible, compare their purpose and specificity to this page; don’t mark every useful section as main. Keep repeated site elements such as navigation, logos, and sidebars outside it unless one of those is itself the page’s main function. A document should not have more than one <main> unless the others are hidden. [S1]
The question, the details, the next step.
A practical checklist
Write the page’s central topic or application function in one sentence.
Choose the region containing its dominant content or central function.
Keep repeated navigation, logos, sidebars, and copyright material outside unless they are the page’s main function.
Put related parts of one central topic inside the same main region when appropriate.
Check that the document has no more than one
<main>unless additional ones are hidden.
A few more useful answers
Can two separate content panels both belong inside one `<main>`?
Yes, if both contribute to the page’s central topic or application function. The key decision is which region represents the dominant content, not how many visual panels the page has.
Should a related-links sidebar usually be inside `<main>`?
Usually it is supporting material rather than the page’s dominant content. The guidance describes sidebars as repeated material to keep out of the main region unless that material is the page’s main function. [S1]
Does this guidance determine the correct markup for every dashboard?
No. It establishes the role of <main> and the limit on multiple main elements, but it does not classify every dashboard layout. Decide from the actual page purpose and content.
Sources
References used for this guide.
- [S1] The HTML main element — MDN developer.mozilla.org · Checked
