html - Should A WordPress Post Thumbnail Have role="presentation" in it? -


i writing theme new site , want friendly can assistive technologies. such, wondering including role="presentation" in display of call of post thumbnail.

the html generated php looks follows:

<figure class="featured-image">     <a href="{permalink}">        <img src="{featured image}" alt="{description}">     </a> </figure> 

should include role="presentation" and, if so, should go in <figure> element?

if @ w3 specification roles:

  1. [role="presentation"] negates implicit 'heading' role semantics not affect contents. <h1 role="presentation"> sample content </h1>

  2. there no implicit role span, contents <span> sample content </span>

  3. this role declaration redundant. <span role="presentation"> sample content </span>

  4. in cases, element contents exposed accessibility apis without implied role semantics. sample content

saying role="presentation" has given heading, state either <figure> or <figcaption> use role here.

however:

if element role of presentation focusable, user agents must ignore normal effect of role , expose element implicit native semantics, in order ensure element both understandable , operable. authors should not provide meaningful alternative text (for example, use alt="" in html4) when presentation role applied image.

since we're having alt tag on image, it's redundant use role="presentation" well, , leave <figure>. is, if wish use it, because seems little on top, quoting w3 again on role="presenation":

an element implicit native role semantics not mapped accessibility api.

since image gets mapped, , figure using figcaption explain it's content further, i'd not have use role="presenation" here.

source: w3c on roles


Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - IE9 error '$'is not defined -