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

Do not automatically set alt and title atttributes of images #45

Open
thet opened this issue Sep 13, 2021 · 3 comments
Open

Do not automatically set alt and title atttributes of images #45

thet opened this issue Sep 13, 2021 · 3 comments
Assignees

Comments

@thet
Copy link
Member

thet commented Sep 13, 2021

During some WAI-ARIA work for a client we came across the automatic setting of title and alt attributes on images if those attributes are not already set.

The alt attribute is set to the description or the title
The title attribute is set to the title.

In many cases this makes little sense.
If the description is empty and the title was automatically set to the id of the image, both alt and title tag get the image id set. Screenreaders do read those information out loud. Users using screenreaders do not gain any useful information and are instead distracted from the content.

I suggest to remove the automatic setting at all or at least only the automatic setting for the alt tag if a description was defined.

@tobiasherp
Copy link
Contributor

I second that.
The alt attribute is most often used wrongly; it is the alternative textual representation for cases the image can't be displayed, and by default should be the empty string.
The title attribute is usually displayed as a tooltip when hovering with the mouse and should never be simply set to the value of the image id, "just to have a title". Such titles are distracting and should be avoided.

@MrTango MrTango self-assigned this May 24, 2022
@MrTango
Copy link
Contributor

MrTango commented May 24, 2022

I removed the title but keeped the alt from description.
If you provide a alt text in TinyMCe this should be keeped.
Please test it in #49 or with the plip-file in coredev.

@MrTango
Copy link
Contributor

MrTango commented May 24, 2022

and maybe it's time to think about adding a dedicated alt field to images ;).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants