Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

In HTML5, the `alt`-attribute can be left out there is no way to provide an appropriate alternative text. The spec provides the example of "a blind photographer sharing an image on his blog".

In general though, the `alt`-attribute should be present. If the image is purely decorative, the value should be an empty string (although CSS rather than `img`-tags are recommended for purely decorative images anyway).

The purpose of the alt-text is some text to replace the image if you are browsing without images (e.g. using lynx or a screen-reader). Empty string means no replacement text, while a missing alt-attribute could be replaced with a text saying eg. "[unknown image]".

It makes sense.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: