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

Tati Gvozdik
Tati Gvozdik
746 Points

Why Guil doesn't use <main> section when he uses <article> ?

Why Guil doesn't use <main> section when he uses <article> in his video "Marking Up a Blog Post"? He has mentioned that "an article is a self contained component in a page". So what? I don't need use <main> section after this?

Matthew Lawson
Matthew Lawson
7,283 Points

I guess you could use the <main> tag if you wanted to add any particular style elements to the main area of the page.

2 Answers

Emmanuel Molina
Emmanuel Molina
9,268 Points

According to the W3C specification there is only one <main> per page and it must never has an <article> as a parent.

https://www.w3.org/TR/html5/grouping-content.html#the-main-element

But the MDN partially disagree :

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/main

Choose your side :)

Guil Hernandez
STAFF
Guil Hernandez
Treehouse Teacher

Hi Tati Gvozdik,

You could also use <main>. I used <article> to represent a full self-contained composition.