accessibility - Using Aria role article and/or listitem? -


i have list of articles in ul list. reading http://www.w3.org/wai/pf/aria/roles#role_definitions can either use roles list , listitem per item, considered article.

option 1: can following (have 2 roles on same element):

<ul role="list"> <li role="listitem article">...<li> </ul> 

option 2: should use article role:

<ul> <li role="article">...<li> </ul> 

you should use option 3 :)

<ul role="list"> <li role="listitem">...<li> </ul> 

all want let assistive technologies understand markup of content.

actually, assisted technologies, "role" attribute required on rich internet content, sliders, , many html5 elements.

if worried screen readers working code, marking such list correctly suffice.

good example

<p> list </p> <ul role="list"> <li role="listitem"> list item 1 <li> </ul> 

bad example

<p> list </p> <p> - list item 1 </p> 

the difference between two, when screen reader comes "good example" read, "this list, list contains 1 item, item 1 of 1 - list item 1"

with "bad example", screen reader read "this list dash list item 1"

keep in mind though, assitive technology not working "good example" because of "role" attribute. working because used correct markup create list (<ul> <li> tags). although, practice include role attribute though not required make list accessible.

someone feel free point out more goodies :)


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -