-
Valerrr
Hello, I have created a Loop Item with posts. The URL address leads directly to the article from the image and headline.
I am interested in the best practices for inserting into the ARIA Label in the image or headline. I want everything to work as well as possible.:)
Look: https://imgur.com/a/5hpmNtc
Test page: https://vitasimo.cz/qq/
Thank you
-
Hi there,
For headlines and headings, the best practice is to avoid using
aria-labelentirely and instead use native HTML heading elements (<h1> through <h6>) with descriptive visible text. The visible heading text itself serves as the accessible name that screen readers will announce.For images, follow this hierarchy for providing accessible names:
– Use
altattribute as the primary method for providing alternative text on images.– Only add
aria-labelto a parent link or button that wraps the image, not to the image itself.– If an image is purely decorative, use an empty
alt=""oraria-hidden="true"to hide it from screen readers.
- You must be logged in to reply to this topic.