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

William Safstrom
William Safstrom
1,203 Points

Do we need to use article and section?

Do we need to use article and section or can we skip them? I still don't understand what they do.

You will have to use them with the current standard of HTML5. If you still don't understand them, do not skip the section, but take your time with it. Both elements are vital for clean semantics and you will need to understand how and when to use each as <div> is partially replaced with both article and section elements, along with a few others that the course also list. If you have any specific questions after completing that section, help is surely here.

1 Answer

David McNeill
David McNeill
44,438 Points

Technically you don't have to use these elements to construct and style a webpage, but if you are considerate about the semantic meaning of your markup it will yield benefits for you, other developers and, most importantly, the users of your site.

Having semantic markup allows screen-readers and other assistive devices to better read the page and recognise its structure, helping users with visual or motor-related impairments to navigate and use the content properly.

As a developer it's easier to scan through markup and see tags like <section>, <aside> or <article> than reading every class or ID on every <div> to work out what it does. This also means it helps with styling, as you have more elements to target and can rely less on classes and/or ids. It also helps other developers who may need to work on your markup at some point but wouldn't obviously be as familiar with it as you are.

Also as Kelli pointed out, the HTML5 standard and the W3C standards all require the use of semantic markup. If you want your site/app/product to pass important benchmarks, it's really important that your markup passes these standards.

Hope this helps William!

William Safstrom
William Safstrom
1,203 Points

Thank you for you time to help me! So if I understand this right. The Section and article isn't actually doing anything special. It's more like a name to easier understand what the code inside this elements are.