r/ProgrammerHumor • • Sep 02 '21

Semantic HTML conveys meaning

Post image
10k Upvotes

234 comments sorted by

View all comments

Show parent comment

24

u/Alokir Sep 02 '21

Yes, screen readers don't just read the text from a webpage but also give clues of what they are reading.

For example if you use a <nav /> tag or use role="navigation" the screen reader will indicate that it's entering an area meant for navigation.

Also, you can use ARIA labels to make even complex widgets usable with a keyboard and understandable with just a screen reader.

If you build your website in a way that you can navigate between important elements with the tab key, and you move into a tab control the screen reader will read something like

Main navigation tab control, first of six tabs, My Feed, selected

if you're using semantic html and ARIA labels correctly