Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML HTML Basics Structuring Your Content Grouping Content with <main> and <div>

W3C specification doesn't permit <main> to be used as a descendant of <article>, <aside>, <footer>, <header>, or <nav>.

MDN Article. So I can't use <main> before <article>, <aside>, <footer>, <header>, or <nav>. Can I? Or I misunderstood meaning of the word descendant?

2 Answers

Tianni Myers
Tianni Myers
10,453 Points

I believe you just can’t nest <main> inside of the other tags in layman’s terms.

So I can't use <main> inside <article>, <aside>, <footer>, <header>, or <nav>. Am I right? Or I can use it only inside <body> but not inside other tags.

Tianni Myers
Tianni Myers
10,453 Points

Right. Check out this diagram from W3C. That's generally how the tags should be used. https://www.w3schools.com/html/html5_semantic_elements.asp