Accessibility and alt Attributes
The alt
attribute is important for a number of reasons: it describes an image for screen readers used by those without sight or poor sight, it describes the image to bots, and it provides an indicator of what should have loaded if the image fails to load at all. But what about the case where the image doesn't have much value to be read, because it has accompanying positioned text offscreen?
Don't omit the the alt
attribute -- the screen read will read out the image's src
attribute. Gross. Instead include the alt
attribute with an empty value:
<img src="/path/to/image.png" alt="" />
No image alt
or src
text is read and you're golden!
![Detect DOM Node Insertions with JavaScript and CSS Animations]()
I work with an awesome cast of developers at Mozilla, and one of them in Daniel Buchner. Daniel's shared with me an awesome strategy for detecting when nodes have been injected into a parent node without using the deprecated DOM Events API.
![Conquering Impostor Syndrome]()
Two years ago I documented my struggles with Imposter Syndrome and the response was immense. I received messages of support and commiseration from new web developers, veteran engineers, and even persons of all experience levels in other professions. I've even caught myself reading the post...
![Create a Context Menu with Dojo and Dijit]()
Context menus, used in the right type of web application, can be invaluable. They provide shortcut methods to different functionality within the application and, with just a right click, they are readily available. Dojo's Dijit frameworks provides an easy way to create stylish, flexible context...
![Chris Coyier’s Favorite CodePen Demos II]()
Hey everyone! Before we get started, I just want to say it's damn hard to pick this few favorites on CodePen. Not because, as a co-founder of CodePen, I feel like a dad picking which kid he likes best (RUDE). But because there is just so...
Really good! I added a sniping code to my editor to remember the alt attribute. Other attributes very important are the following:
I’m from Brazil and these tags are really important for softwares that reads screens.
Definitely in agreement with this. When I studied Software Engineering at university we had a module on human-computer interaction and part of it included making your website accessible to those with poor vision.
Now I always try to have a high contrast between the color of the text and background color being used, and like you mention I always use the alt tags to, for example to prevent spam I put the email address on my sites contact pages in an image and then put the email address in the alt tag as well such as “my name at my domain dot com” so that if anyone is using a screen reader that clearly states what the email address is. I do the same with logos too, put something like “my website dot com logo” for the same reason.
If the images are of a product or something I try to get some keywords in there, and since doing this I get a few hits from Google image search sometimes, so that can help a bit with SEO and stuff.
Anyhow thanks for publishing this, I think too many people forget about how important it is.