DEV Community

Discussion on: 5 accessibility principles you can start implementing now

Collapse
 
ezzabuzaid profile image
ezzabuzaid • Edited

I know the tags names are meaningful but when it comes to real usage they are really hard to use in proper way.

Especially tags like article and section.
Any guidance will be appreciated šŸ™.

Collapse
 
elischei profile image
Eli H. Schei • Edited

Lets use this current page on Dev.to as an example. :)

The content of my post could be inside of an <article> element. Since the content would make sense alone - outside of the dev.to context.

But the area for the comments could be inside a <section> element since they would not make sense on their own (so not an article), and section is a way to group things that does not fit in any of the other semantic elements. This section could be placed inside of the article too - since they make sence together.

But the "Read next" component in the bottom could be another <section> , outside of the article.

I try to think that a section is a way of grouping content togeteher. Would it make sence to say "The comment section" and the "Read next section" to explain which part of the page I'm talkin about? If yes - then I use a section. (If there is not a more appropriate element to be used).

Collapse
 
ezzabuzaid profile image
ezzabuzaid

Okay that's helpful. Using Dev.to as an example is brilliant šŸ‘

Thank you very much.