Support » Accessibility » Role group attribute for figure tag

  • Hello,

    WCAG recommend to use a “role” attribute with “group” value for “figure” tag. This is for assistive technologies that don’t recognize “figure” tag.
    An “aria-labelledby” on the “figure” tag referring to the id of “figcaption” tag should also be added.

    Could these attributes be added to WordPress?

    Example:

    <figure role="group" aria-labelledby="fig11">
      <img src="castle-etching.jpg" alt="The castle has one tower, and a tall wall around it.">
      <figcaption id="fig11">Charcoal on  wood. Anonymous, circa 1423.</figcaption>
    </figure>

    Source: https://www.w3.org/WAI/tutorials/images/groups/#a-collection-of-images

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Andrew Nevins

    (@anevins)

    Forum moderator

    Hi @crakotte, I think the W3C’s example here is for a group of images specifically. Is that what you’re using in WordPress? The markup should be a nested figure element (within a figure element).

    Hi,

    The W3C’s example is also for images with a legend (figcaption). If you look at the code, you have a “figure” tag around some others “figure” tags. And those others “figure” tags also have the “role” and “aria-labelledby” attributes.

    So, one image with a legend should also have these attributes. In WordPress, we already have the right tags “figure” and “figcaption”. It just lacks a little piece of code 🙂

    Edit:
    If we see here : https://www.w3.org/WAI/tutorials/images/complex/, “aria-labelledby” is not necessary. So, we need only the “role” attribute (easier!).

    • This reply was modified 8 months, 2 weeks ago by  crakotte.

    Hi, @crakotte – Thanks for pointing this out! There is an open ticket about these relationships, and I’ve added a link to this thread so that this specific comment is taken into consideration.

    https://core.trac.wordpress.org/ticket/34595

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Role group attribute for figure tag’ is closed to new replies.