WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Landmark and HTML 5

for

From: Patrick H. Lauke
Date: Mar 9, 2020 2:04PM


On 09/03/2020 18:20, Jayakar, Ritu wrote:
>
> I find contradictory information on using "role" for the HTML elements main, nav, aside and header footer. Some say these elements should be used in conjunction with aria role e.g.: <main role="main"> so that screen readers which do not recognize HTML 5 can read the role tag to recognize the section. My site needs to be tagged with landmark, I need to decide if it useful to implement, if yes what is the best practice to implement landmarks, add the role to HTML 5 elements or not.

Out of the "modern" browsers, I believe only IE11 has problems with
recognising/exposing <main> (and I seem to remember that some screen
readers will silently patch this issue by looking at the actual DOM).

In general, unless you're explicitly targetting older browser/AT
versions (e.g. because you know from your stats/your market that older
versions are still widely in use for your particular audience), you can
just use the native HTML5 elements without additional redundant
role="..." attribute.

Having said that, adding redundant role attributes won't do any harm
either. They may be superfluous, but don't really add that much more
weight to your page. So you could play it safe and do both (native HTML
element with redundant role that says the same thing). It won't have any
adverse effect.

P
--
Patrick H. Lauke

https://www.splintered.co.uk/ | https://github.com/patrickhlauke
https://flickr.com/photos/redux/ | https://www.deviantart.com/redux
twitter: @patrick_h_lauke | skype: patrick_h_lauke