Re:Front-End Checklist
by Teichopsia on Wednesday October 18, 2017 @02:54PM
(#15501886)
Do you mean like that? Empty quotes and it would not be read?
[ Parent
| on HN ]
Re:Front-End Checklist
by robin_reala on Wednesday October 18, 2017 @03:12PM
(#15502036)
Exactly. Every img element should have an alt attribute; those with visual content should have explanatory text in it.
What is the value of having an alt attribute if its value is blank? Just to tell someone poking at the source code that, "yeah, I know I'm supposed to have this, and it's intentionally left blank"?
No, the reason given was
> give it an empty alt attribute to indicate to the screen reader that it shouldn’t try to read out the file name or something
Re:Front-End Checklist
by Teichopsia on Wednesday October 18, 2017 @03:40PM
(#15502238)
:D I knew that. I'm not that noobish.
Let's see. If we use an image that doesn't add anything to the content, one would normally use background-attachment to add an image to say, the hero section.
(It seems you edited your comment?)
Good to know that the screen reader would try to read the file name if there isn't any alt text in it, I didn't know that. So, in the cases we do need to place an img in the document, then we simple place an empty alt text as in my above comment to tell the screen reader not to read the file name since it is only used for decorative purposes...?
Edit: I confused your comment with another one.