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>

Why would you use this tags?

I didt get why you want to use the different tags: main, article, and so on..

1 Answer

Hey Eduardo Yanguas,

That's a good question. Semantic tags are used to define the purpose of the element. It adds meaning to a webpage rather than just a presentation. Also it is very useful when it comes to accessibility. Each semantic tags has its own meaning. For example <section> tag defines separate section within a webpage:

<section>
  <h1>Section Heading</h1>
  <p>The section tag can contain any elements.</p>
  <img src="image.png" alt="section example">
</section>

To learn more about HTML5 Semantic Tags, check out this link: https://www.bitdegree.org/learn/html5-semantic-tags

Hope this helps!