문제

<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 "display 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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top