A question for the truly pedant
I was looking through Chrome's Developer Tool's elements tab when something caught my eye and prompted this question.
Though meaningful alt
attributes on img
tags are a necessary expectation for accessibility (<img src="/path/to/beauty.png"
alt="Olivia Culpo won the Miss USA 2012 contest"/>
), I have seen it often advised that the alt
attribute of "spacer", or other "decorative" images should be given a blank value: <img src="/images/spacer.gif" alt
=""/>
These questions are just for decorative images:
- What happens if I declare the alt attribute, but don't define it:
<img src="/images/spacer.gif"
alt/>
- Of the two options, which is optimal (and why)?