Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add alt attributes to images #21616

Closed
estelle opened this issue Oct 18, 2022 · 2 comments · Fixed by #23014
Closed

Add alt attributes to images #21616

estelle opened this issue Oct 18, 2022 · 2 comments · Fixed by #23014
Labels
good first issue A good issue for newcomers to get started with. help wanted If you know something about this topic, we would love your help!

Comments

@estelle
Copy link
Member

estelle commented Oct 18, 2022

What information was incorrect, unhelpful, or incomplete?

There used to be 404 missing alt attributes. We are down to 123. We need people to help complete the remaining 123 image descriptions.

The list of missing alt attributes

There are three sheets in that file:

  • General missing alt attributes images
  • Missing alt descriptions in images from WebExtensions
  • Images that may or may not need an alt attribute from HTML code examples (some may be example of bad markup or similar)

What did you expect to see?

Every image in MDNs content should have a useful alt attribute (the one exception: code blocks that explain bad HTML practices)

Information on writing effective alt image descriptions

Alt attributes aim to be short and concise, providing all the relevant information as the attribute value that the image conveys to a person who is able to see the image.

When writing an alt attribute, think about the useful information the image conveys to you and how you would relay that information to someone who can read all of the page's content but just can't load images. What information does the image convey that is important and relevant to the user?

The content of the alt attribute for an image differs based on the context. For example, if the photo of Fluffy the dog is an avatar next to a review for Yuckymeat dog food, alt="Fluffy" is appropriate. If the photo is part of Fluffy's adoption page for the animal rescue society, the information conveyed in the image that is relevant for a prospective dog parent that is not duplicated in the surrounding text should be included. A longer description, such as alt="Fluffy, a tri-color terrier with very short hair, with a tennis ball in her mouth." is appropriate. As the surrounding text likely has Fluffy's size and breed, you would not be included in the alt: that information is provided in the content and would therefore be redundant. As the dog's biography likely doesn't include hair length, colors, or toy preferences, which is important for adoption reasons but not in a dog food review. Don't describe the image: the prospective parent does not need to know if the dog is in- or out-doors, or that it has a red collar and a blue leash

All information image conveys that a sighted user can access and is relevant to the context is what needs to be conveyed; nothing more. Keep it short, precise, and useful.

With screenshots, write what is learned from the image, don't detail the contents of the screenshot. You can omit information they don't need or already know. For example, if you're on a page about changing settings on Bing, if you have a screenshot of a Bing search result, don't include the search term or number of results, etc. as those are not the point of the image. Limit the alt to the topic at hand: how to change settings in Bing. The alt might be "The settings icon is in the navigation bar below the search field." Don't include "screenshot" or "Bing" as the user doesn't need to know it's a screenshot and already knows it's Bing as they are on a page explaining changing Bing settings.

Writing alt text

![<description>](imageSrc)
<img alt="description" src="imageSrc">
@github-actions github-actions bot added Content:HTML Hypertext Markup Language docs needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. labels Oct 18, 2022
@estelle estelle added good first issue A good issue for newcomers to get started with. help wanted If you know something about this topic, we would love your help! and removed needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. labels Oct 18, 2022
@Josh-Cena Josh-Cena removed the Content:HTML Hypertext Markup Language docs label Oct 18, 2022
@estelle estelle changed the title Accessibility: Add alt attributes to images Add alt attributes to images Oct 18, 2022
This was referenced Oct 20, 2022
dawei-wang added a commit to dawei-wang/content that referenced this issue Oct 21, 2022
Add alt text. Chose to use an empty alt because the image is described by the previous sentence in the article. Relates to mdn#21616
dawei-wang added a commit to dawei-wang/content that referenced this issue Oct 21, 2022
Add alt text to inspector-sidebar.png
Relates to mdn#21616
estelle added a commit that referenced this issue Oct 21, 2022
* Add alt text

Add alt text to inspector-sidebar.png
Relates to #21616

* Update files/en-us/mozilla/add-ons/webextensions/api/devtools/panels/extensionsidebarpane/index.md

Co-authored-by: Estelle Weyl <estelle@openwebdocs.org>
dawei-wang added a commit to dawei-wang/content that referenced this issue Oct 21, 2022
Add alt text to sauce-manual-session.png, sauce-test-running.png, browserstack-test-choices-sized.png, browserstack-test-devices-sized.png, browserstack-test-menu.png, screen_shot_2019-04-19_at_14.55.33.png.

Relates to mdn#21616
dawei-wang added a commit to dawei-wang/content that referenced this issue Oct 21, 2022
Add alt text to bstack_automated_results.png, bstack_custom_results.png, sauce_labs_automated_test.png, sauce_labs_updated_job_info.png
Relates to mdn#21616
dawei-wang added a commit to dawei-wang/content that referenced this issue Oct 22, 2022
Add alt text to css-styling.png, console-timelog.png, api-trace2.png. Relates to mdn#21616
dawei-wang added a commit to dawei-wang/content that referenced this issue Oct 22, 2022
Add alt text to console-table-array.png, console-table-simple-object.png. Relates to mdn#21616
dawei-wang added a commit to dawei-wang/content that referenced this issue Oct 22, 2022
Add alt text to timer_output.png Relates to mdn#21616
dawei-wang added a commit to dawei-wang/content that referenced this issue Oct 22, 2022
Add alt text to timer_output.png Relates to mdn#21616
dawei-wang added a commit to dawei-wang/content that referenced this issue Oct 23, 2022
Add alt text to mouseenter.png, mouseover.png
Relates to mdn#21616
dawei-wang added a commit to dawei-wang/content that referenced this issue Oct 24, 2022
Add alt text to mouseleave.png, mouseout.png Relates to mdn#21616
@github-actions github-actions bot added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Nov 9, 2022
@sideshowbarker sideshowbarker removed the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Nov 9, 2022
dawei-wang added a commit to dawei-wang/content that referenced this issue Nov 17, 2022
Add alt text to stroboscopic-effect.gif, motion-comp-diff.jpg
Relates to mdn#21616
Rumyra pushed a commit that referenced this issue Nov 24, 2022
* #21616 Add alt text, blank_path_area.png, path_line_commands.png

* #21616 Add alt text
shortcut_cubic_bézier_with_grid.png
shortcut_quadratic_bézier_with_grid.png

* #21616 Add alt text
Updated alt text for svgargs_flags.png
dtrannam added a commit to dtrannam/content that referenced this issue Nov 29, 2022
estelle pushed a commit that referenced this issue Nov 30, 2022
Add alt text to stroboscopic-effect.gif, motion-comp-diff.jpg
Relates to #21616
Elchi3 added a commit that referenced this issue Dec 5, 2022
estelle pushed a commit that referenced this issue Dec 7, 2022
* alt tag added for presentation_mode_illustration.png

* reverting to b713a31

* added alt tag -> presentation_mode_illustration.png

Co-authored-by: Kyle Williams <kylewilliams@Kyles-MacBook-Pro.local>
wbamberg added a commit to wbamberg/content that referenced this issue Dec 8, 2022
* upstream/main: (286 commits)
  Correct Epsilon property description (mdn#22804)
  Fix typo in subtle crypto digest (mdn#22802)
  Alt tag added - reference issue mdn#21616 (mdn#22255)
  WeakSet: Improve recursive validation example (mdn#22787)
  New page: validityState.valueMissing (mdn#22691)
  Edit: <dialog> element (mdn#22786)
  Update Paint Timing pages (mdn#22771)
  chore(deps): bump @mdn/yari from 1.27.16 to 1.27.20 (mdn#22791)
  chore(deps): bump technote-space/get-diff-action from 6.1.1 to 6.1.2 (mdn#22790)
  Remove WebGLSidebar (mdn#22782)
  fix indefinite articles usage (mdn#22789)
  Removed part of sentence that refers to code that appears to have been removed (mdn#22788)
  Split (Async)?(Generator)?Function class and ctor pages (mdn#22778)
  Fix interfaces links (mdn#22779)
  Change "hypertext link" to "hypertext links" (mdn#22780)
  add hyphenate-limit-chars CSS property (mdn#22747)
  22225: Add links to accessibility guides section (mdn#22240)
  ci(markdownlint): use GitHub API to get changed files (mdn#22773)
  Document font-palette & @font-palette-values with its descriptors (mdn#22519)
  fix typo in createImageBitmap api (mdn#22774)
  ...
hamishwillee pushed a commit to hamishwillee/content that referenced this issue Dec 12, 2022
* mdn#21616 Add alt text, blank_path_area.png, path_line_commands.png

* mdn#21616 Add alt text
shortcut_cubic_bézier_with_grid.png
shortcut_quadratic_bézier_with_grid.png

* mdn#21616 Add alt text
Updated alt text for svgargs_flags.png
hamishwillee pushed a commit to hamishwillee/content that referenced this issue Dec 12, 2022
Add alt text to stroboscopic-effect.gif, motion-comp-diff.jpg
Relates to mdn#21616
hamishwillee pushed a commit to hamishwillee/content that referenced this issue Dec 12, 2022
hamishwillee pushed a commit to hamishwillee/content that referenced this issue Dec 12, 2022
* alt tag added for presentation_mode_illustration.png

* reverting to b713a31

* added alt tag -> presentation_mode_illustration.png

Co-authored-by: Kyle Williams <kylewilliams@Kyles-MacBook-Pro.local>
estelle pushed a commit that referenced this issue Dec 12, 2022
* alt tag added for presentation_mode_illustration.png

* reverting to b713a31

* added alt tag -> presentation_mode_illustration.png

* removed alt tag from presentation_mode_illustration.png on main branch

* added alt tag for stereopannernode.png

Co-authored-by: Kyle Williams <kylewilliams@Kyles-MacBook-Pro.local>
estelle added a commit that referenced this issue Dec 13, 2022
* Add alt text for svg_stroke images

Relates to #21616 
Updated line 173/174/175 https://docs.google.com/spreadsheets/d/1bUHax8ztRFt_mFaZaZAf66zdAgOVFlKMx9wMhJttQQA/edit#gid=790929018

* Apply suggestions from code review

Co-authored-by: Estelle Weyl <estelle@openwebdocs.org>
@kylewcode
Copy link
Contributor

@estelle
svg_pattern_comparison_of_units.png for https://developer.mozilla.org/web/svg/tutorial/paths was marked as "not done" in the sheet, however when I went to go edit it in my updated mdn/content fork, the alt tag text was present. However the MDN website itself is showing the alt tag is empty. I don't understand why this is the case.

The text I found in my code editor after fetching the latest mdn/content is this, "Three examples showing patternUnits values of default and userSpaceOnUse and patternContentUnits values of default and objectBoundingBox. When both are set to default, the aspect ratio is maintained with white space visible. Setting patternContentUnits to objectBoundingBox effects the aspect ratio to remove white space. Setting patternUnits to userSpaceOnUse maintains the aspect ratio while eliminating white space."

@estelle estelle linked a pull request Dec 16, 2022 that will close this issue
@estelle
Copy link
Member Author

estelle commented Dec 16, 2022

@kylewcode You likely viewed the page after the PR for that alt text was merged but before edits were pushed to production.

I just went thru the code base. There is only one case of ![] which is on the page explaining how to write alt text in markdown, which means WE DID IT!!!!

Thank you everyone for all the amazing work. When we started with had 404 ![] missing alt attributes in markdown, and about 100 more in HTML. Because of all of your work, we can now add an alt attribute checker to the linter so we don't get any new missing text descriptions. Thank you. Thank you. Thank you!

@estelle estelle closed this as completed Dec 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue A good issue for newcomers to get started with. help wanted If you know something about this topic, we would love your help!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants