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
Chris Gabler
1,262 PointsCan someone explain to me when should I use the article tag or the aside tag?
Would like to know when to use the article tag and aside tag? Also, do they both go in the section tag?
3 Answers
Kerry Collier
16,151 PointsThe <aside> tag defines some content aside from the content it is placed in.
The aside content should be related to the surrounding content. https://www.w3schools.com/tags/tag_aside.asp
The <article> tag specifies independent, self-contained content.
An article should make sense on its own and it should be possible to distribute it independently from the rest of the site.
Potential sources for the <article> element:
Forum post Blog post News story Comment
Chris Gabler
1,262 PointsKerry,
Does both the aside and article tag go inside the section tag as well?i And, the article tag can be used when and for type of content?
Thank you so much!
Kerry Collier
16,151 PointsThe Aside likely would as it should pertain to content that it is near, the Article would seem to have the flexibility of going anywhere that would be logically appropriate, from how I understand it. It would function much like the section tag does from my reading of them. There's some context as to when it would be better to use one over the other, but it's likely open to interpretation. If it would make sense to put the article in section, so be it, or to have it as it's own area outside of it, then go for it. The examples given on the W3C's page for both look the same, just with one with the section tag and one with article.
Chris Gabler
1,262 PointsThank you so much Kerry! I am abit confused is to when use the section, aside, and article tag?! The section tag serves as the main content area in the html, correct?! And, the aside tag is used specifically for something independently pertaining to the main content, correct?! Can you nest the aside tag inside the section tag?!
Kerry Collier
16,151 PointsYes. Check those links out, they give some good examples of how to use each. The aside appears to be one you'd want to nest with something else.