---
url: "https://web.dev/learn/accessibility/images"
titulek: "Images | web.dev"
h1: "Images Stay organized with collections Save and categorize content based on your preferences."
popis: "Create accessible images."
jazyk: "en"
kanonicka: "https://web.dev/learn/accessibility/images"
drobecky: ["web.dev", "Resources", "Accessibility"]
zdroj: "live"
wayback_snapshot: ""
stazeno: "2026-09-14 01:47:28"
znaku: 10861
slov: 1604
kodovani: "iso-8859-2"
sha256: "73751e5f288cf7beb06db3e74102f9151ad6cbcf2b9dab444b11888f026736b8"
---
Images
Stay organized with collections
Save and categorize content based on your preferences.
Accessible images may seem like a quick topic at first glance—you add
some "alt text" to an image, and you are done. But, the topic is more nuanced
than some people think. In this section, we'll review: How to update the code to make images accessible. What information should be shared with users and where to share it. Additional ways to improve your images to support people with disabilities. Image purpose and context Before you write even one line of code, think about the point image's purpose,
where it will live, and how it will be used. Asking yourself these questions
can help you determine how best to convey the information to a person using
[assistive technology (AT)](https://www.nichd.nih.gov/health/topics/rehabtech/conditioninfo/device),
such as a screen reader. You may ask yourself: *Is the image essential to understanding the context of the feature or page?* *What type of information is the image trying to convey?* *Is the image simple or complex?* *Does the image elicit emotion or prompt the user to act?* *Or is the image just visual "eye candy" with no real purpose?* A visual flowchart, such as an
[image decision tree](https://www.w3.org/WAI/tutorials/images/decision-tree/),
can help you decide which category your image belongs to. Try hiding the images on your site or web app using a browser extension or
other methods. Then ask yourself: "Do I understand the content that remains?"
If the answer is yes, it's most likely a decorative image. If not, the image
is instead informative in some way and contextually necessary. Once you
determine the image's purpose, you can determine the most accurate way to code
for it. Decorative images A [decorative image](https://www.w3.org/WAI/tutorials/images/decorative/) is a
visual element that doesn't add additional context or information that allows
the user to better understand the context. Decorative images are supplemental
and may provide style rather than substance. If you decide an image is decorative, the image must be programmatically hidden
from ATs. When you program an image to be hidden, it signals to the AT that the
image is not needed to understand the page's content, context, or action. There
are many ways to hide images, including using an empty or null text alternative,
[applying ARIA](https://developer.mozilla.org/docs/Web/Accessibility/ARIA), or
adding the image as a CSS background. Here are a few examples of how to hide a
decorative image from users. Empty or null `alt` An empty or null alternative text attribute differs from a missing alternative
text attribute. If the alternative text attribute is missing, the AT might read
out the filename or surrounding content to give the user more information
about the image. Role set to `presentation` or `none` A role set to
[`presentation` or `none`](https://developer.mozilla.org/docs/Web/Accessibility/ARIA/Roles/presentation_role)
removes an element's semantics from exposure to the accessibility tree.
Meanwhile, [`aria-hidden= "true"`](https://developer.mozilla.org/docs/Web/Accessibility/ARIA/Attributes/aria-hidden)
removes the entire element—and all of its children—from the
accessibility API. `
` Use `aria-hidden` with caution as it may hide elements that
you don't want to hide. Images in CSS When you add a background image with CSS, a screen reader cannot detect the
image file. Be sure you want the image to be hidden before applying this method. Informative images An [informative image](https://www.w3.org/WAI/tutorials/images/informative/)
is an image that conveys a concept, idea, or emotion. Informative images
include photos of real-world objects, essential icons, simple drawings, and
[images of text](https://www.w3.org/WAI/WCAG22/Understanding/images-of-text.html). If your image is informative, you should include
[programmatic alternative text](https://www.w3.org/WAI/WCAG21/Understanding/non-text-content.html)
describing the purpose of the image. Alternative image descriptions—often
abbreviated as "alt text"—give AT users more context about an image and
help them better understand an image's message or intent. You can add alternative descriptions to
[`` elements](https://developer.mozilla.org/docs/Web/HTML/Element/img#attr-alt)
by including the `alt` attribute. This applies to all file types, including
JPG, PNG, or an SVG. `` When you use `