Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is the alt attribute for img tag in HTML not supported by Safari on Windows?

When I use the alt attribute with img tag in Safari on Windows, instead of displaying the alternate text, Safari only shows a "?" in a box. Is this a bug in Safari on Windows, or Safari is missing this feature.

like image 327
rohitmishra Avatar asked Feb 27 '10 18:02

rohitmishra


2 Answers

Every browser has its own magical way of rendering alternate text. It seems to be a standards issue, hopefully to be resolved in the future HTML5 specs.

IE, Firefox, & Opera render the alternative text inside IMG for broken images. Chrome & Safari also do this, but the text will be cutoff you unless you set the height/weight of the image.

Here is an excellent article on the issue (with screen caps that show how each browser renders the alt text).

http://rebuildingtheweb.com/en/how-should-browsers-render-alt-text/

More screenies from the Paceillo Group's blog...
http://www.paciellogroup.com/blog/misc/HTML5/alt-tests/screenshots.html
http://www.paciellogroup.com/blog/?p=498

like image 126
John Himmelman Avatar answered Sep 28 '22 23:09

John Himmelman


Never use alt for rendering tooltips. Use title instead. It is supported by almost all browsers. alt is meant to be an alteranative text which should come only if the image is unavailable/cannot be displayed or for some Assistive technologies like screen readers while reading the page.

like image 34
vpram86 Avatar answered Sep 29 '22 00:09

vpram86