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 a11y alt attribute explainer to html img element #36067

Merged
merged 8 commits into from
Oct 16, 2024

Conversation

JohannesBeranek
Copy link
Contributor

@JohannesBeranek JohannesBeranek commented Sep 26, 2024

Description

This adds some explanation on how to choose a good alt attribute for an image and what is meant by the Don't and Do examples already present.

Motivation

The existing example can easily be interpreted as "write down what you see in the image", as there is not much context given as to why or how the alt text was chosen in the Do example.

Additional details

I don't have any experience on committing to MDN and I am not a native speaker, but I've got some experience fighting usability issues. While it's hard to improve on the already existing documentation in a short and concise way, and actually adding anything meaningful that does not go too deep into the topic (there are already references to pages about a11y in that section), I hope I can provide a good base which, with the help of some native speakers, can help improve MDN.

Related issues and pull requests

Fix #36050

This adds some explanation on how to choose a good alt attribute for an image and what is meant by the *Don't* and *Do* examples already present.

Also see #36050 for context.
@JohannesBeranek JohannesBeranek requested a review from a team as a code owner September 26, 2024 17:06
@JohannesBeranek JohannesBeranek requested review from chrisdavidmills and removed request for a team September 26, 2024 17:06
@github-actions github-actions bot added Content:HTML Hypertext Markup Language docs size/s [PR only] 6-50 LoC changed labels Sep 26, 2024
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Copy link
Contributor

github-actions bot commented Sep 26, 2024

Preview URLs

(comment last updated: 2024-10-15 19:25:25)

Copy link
Contributor

@chrisdavidmills chrisdavidmills left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @JohannesBeranek, and thank you so much for your contribution to MDN. I think your suggestions are reasonable, and the language was pretty good. I have got a couple of suggestions for you to consider. My text suggestion is mainly to break up the long run-on sentence you added, and add macros to create links to the element reference pages.

files/en-us/web/html/element/img/index.md Outdated Show resolved Hide resolved
files/en-us/web/html/element/img/index.md Outdated Show resolved Hide resolved
@JohannesBeranek
Copy link
Contributor Author

@chrisdavidmills is this better now?

Thanks for taking the time!

Copy link
Contributor

@chrisdavidmills chrisdavidmills left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @JohannesBeranek, and thank you for your continued work on this. I have a couple more text suggestions for you. If you are happy with these, then I think we can get it merged. Let me know what you think!

files/en-us/web/html/element/img/index.md Outdated Show resolved Hide resolved
files/en-us/web/html/element/img/index.md Outdated Show resolved Hide resolved
@JohannesBeranek
Copy link
Contributor Author

@chrisdavidmills happy with the suggestions, commited them!

Copy link
Contributor

@chrisdavidmills chrisdavidmills left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome. Approving!

Thanks again @JohannesBeranek. Your contribution is much appreciated.

@chrisdavidmills chrisdavidmills merged commit e3977ac into mdn:main Oct 16, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:HTML Hypertext Markup Language docs size/s [PR only] 6-50 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

img alt text examples need more context
2 participants