开发者

Safari doesn't display 'alt' text on Images?

开发者 https://www.devze.com 2023-01-03 14:21 出处:网络
<img src=\"image_that_may_or_may_not_load.png\" alt=\"Show this text if image not loaded\" /> Safari doesn\'t seem to show \'alt\' text in case the image is not loaded. I\'m not sure about oth
<img src="image_that_may_or_may_not_load.png" alt="Show this text if image not loaded" />

Safari doesn't seem to show 'alt' text in case the image is not loaded. I'm not sure about other browsers, but Firefox does show the alternate text.

Its so important to display alt text in email templates where the images would be blocked by the client most likely, atleast until the user accepts to "di开发者_StackOverflowsplay images from this user/site".

Any workaround for this?

Thanks


So it turns out, setting width and height for the image will show alt text incase the image is unavailable, not otherwise.


Try use the title attribute.

<img src="image_that_may_or_may_not_load.png" alt="Show this text if image not loaded" title="Show this text if image not loaded" />

Apparently from here: Alt text showing in IE and firefox but not in safari?. Safari doesn't support it.

0

精彩评论

暂无评论...
验证码 换一张
取 消