Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

HTML

mrx3
mrx3
8,742 Points

I have a question about the article tag, and could use some help.

I'm practicing my semantic markup. I'm confused between two tags, the article, and the section tag. I want to add a table tag to my site, but I'm not sure if I should/could use a article tag, or a section tag. I'm making a site about the tv show The Sopranos, and inside the table tag I'm going to list the actors real name and then next to that have the actors real name.

Any help with which tag I should use would be really appreciated. Thanks in advance for any help.

2 Answers

Alexander Smith
Alexander Smith
2,769 Points

Really either could work. In this case I think article would be best. While not used as a specific example from w3c it does fit the description of the purpose of the tag.

W3C Article Element Section

Section isn't meant to be used for laying out the site. It's most common intended use would probably be in extremely large articles. For layouts/theme purposes only they recommend continuing to use the div tag.

mrx3
mrx3
8,742 Points

Thank Alexander. Much Appreciated.

Treehouse wrote a pretty good article on this on their blog. Article is often referred to being a section that can be moved around, like blog posts and news articles.

Even so, there are a lot of disagreements. Some believe articles can have sections of content in them, others believe that section refers to the the actual visual element of the site, such as where the content would appear, i.e. a content section.

My interpretation is the latter, where your table should be an article, and the content area of your page is the section.

mrx3
mrx3
8,742 Points

Thank you Justin. Much appreciated.