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

Steven Nava
PLUS
Steven Nava
Courses Plus Student 5,144 Points

Is it okay for the aside to go inside of main?

In the previous modules and practices aside was moved outside of main. In fact, in the previous practice, the editor had me remove it from main. Is it okay for it to go inside of main or is it better practice to keep it separate from the main element?

1 Answer

Steven Parker
Steven Parker
229,732 Points

A look at the intended meanings of these elements (taken from the MDN pages) might be enlightening:

The main content area consists of content that is directly related to or expands upon the central topic of a document...

The HTML <aside> element represents a portion of a document whose content is only indirectly related to the document's main content. Asides are frequently presented as sidebars or call-out boxes.

So the semantic meanings of these two elements isn't entirely compatible. Putting an aside inside main would be a bit like putting a blue ball in a box labelled "green shapes". They're both indirectly related because they are shapes.

Steven Nava
Steven Nava
Courses Plus Student 5,144 Points

I see -- thank you for that. I need to make better use of MDN. I thought the case was something similar to what you posted but was confused when the teacher's solution included the <aside> element inside of the <main> element. Thank you for helping to clear it up.