---
title: Add punctuation to your alt text
teaser: 'While alt text end punctuation isn’t technically required for compliance,
  it makes for a better experience for your audience.

  '
tags: accessibility,user experience,html
author: Eric Bailey
published_on: 2021-04-21
---

Providing a concise, accurate text description of an image is [an important
thing to do][wcag]. It allows people who cannot see the image understand its
content.

To add a description to an image, author a string inside of
[an `alt` attribute][alt] declared on an `img` element. Assistive technology
will recognize the presence of the `alt` attribute and read the string as it
moves through the page or view.

In addition to making sure your alt description is accurate, there’s one other thing
you can do that makes for a good experience: ending your alt text string with
punctuation.

```html
<img
  src="puppy.jpg"
  alt="A golden retriever puppy wearing a tiny raincoat." />
```

The presence of end punctuation such as a period will make the voice pause a bit
before announcing the next words in sequence for most assistive technology that
utilizes a synthesized voice. This makes the transition to non-image content
feel a lot more natural.

While alt text end punctuation isn’t technically required for compliance, it
makes for a better experience for your audience. These little details
demonstrate care and consideration, and are noticed and appreciated by those who
rely on them.

[wcag]: https://www.w3.org/WAI/WCAG21/Understanding/non-text-content.html
[alt]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attr-alt
