WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Aria roles instead of headings?

for

From: Duff Johnson
Date: Mar 4, 2013 9:05PM


I have questionsÂ…

On Mar 4, 2013, at 10:58 PM, Jared Smith wrote:

> On Mon, Mar 4, 2013 at 8:40 PM, Christian Biggins wrote:
>
>> One problem is the markup of our search form. It usually sits above the
>> page title (h1) and has been marked up incorrectly with an h2 for the
>> search form title.
>
> There's nothing wrong with having an h2 precede the h1.

Legal HTML, yes, but is it "best practice" for accessibility in HTML?

>> My question is, is it acceptable to wrap the form with a div containing the
>> role 'search' or even give them 'form' tag the 'role' attribute of 'search'
>
> Either (but not both) would be fine. You already have a form element,
> so it'll be cleaner to just add the search role to it.
>
>> rather than having a heading at all up there?
>
> Why not do both? This would provide easier page navigation for users
> that navigate by headings and those that navigate by landmarks.

Why should it be a heading at all? Isn't that question dependent on the context, and the nature of the page (volume of content, etc)? Is this good *generic* advice?

Duff.