Alt Text Behavior

Community Champion

We have noticed that a significant number of the images across our courses do not have alt text. Part of this is a lack of awareness and training on our end, but we have also been looking at whether there might be anything that Canvas could to to better support or encourage alt text when images are added to a course.

Current Situation

  1. Currently when you add an image to a page using the "Insert/Edit Image" functionality from the Rich Text Editor (RTE) you are given the option to add alt text to the image.
  2. If you do not add an image then Canvas has modified the default behavior of the RTE to put the name of the image in as the alt text.
  3. If you delete the file name from the alt text field that automatically populates then it appears to completely remove the alt attribute from the img tag.

Also, a note on screen reader behavior from WebAIM on Designing for Screen Reader Compatibility: "Screen readers ignore images without alternative text and say nothing, but users can set their preferences to read the file name."

Recommendation/ Discussion

I am questioning the default behavior of adding the file name into the alt text, but wanted to get the opinions of others before submitting it as a feature request.

Here is a discussion alt text generated from filename can be harmful for screen reader users regarding a similar issue from Rails that states:

"Autogenerated alt text based on filename creates naïve descriptions that can do more harm than good"

The Functional Accessibility Evaluator tool has a ruleset that says:

"The source filename of the image should not be included because generally it is not useful information."

A Wordpress post describing how they used to insert the image title or file name as alt text and how they removed it to improve accessibility:

"The intent of the fallbacks were to ensure each image included alternative text. In practice however, this fallback behavior often resulted in poor user experiences for people using screen readers."

While automatically adding the file name as alt text may sometimes be helpful, it can also be less helpful that doing nothing. In addition, users can generally set their assistive technology to read the file name if that is the desired behavior. However, if the change were made to not automatically insert the file name into the alt text, there is the question of what to do.


I understand that the Canvas is working on adding the option to indicate whether an image is decorative per this issue: Alt Text "Decorative Image" Option in Rich Content Editor.

With that available, I think the best option would be too require the user to either add alt text or indicate the image is decorative. I would recommend this approach and lead to the most accessible content. However, it does put some added work on the content author that would require some discussion.

If that isn't doable, there are a couple of other options for when a user doesn't

  1. Leave the alt attribute off. This would then support the option allowed by HTML5 to be able to add
  2. Leave the alt text as blank. Not great as this would give the false impression that the image is decorative.

The W3C provides some guidance provides some guidance for markup creators when alt text isn't available:

alt attribute to the empty string, under the assumption that the image is a purely decorative image that doesn't add any information but is still specific to the surrounding content, or omit the alt attribute altogether, under the assumption that the image is a key part of the content.

See further direction at Guidance for markup generators.

What are your thoughts or recommendations on how to handle alt text in Canvas?