How Can I Make Text Behind An Image Before The Image Has Loaded?
Often, I can see some text in an image's place before the image has been loaded. How can I do this myself?
Solution 1:
Put the text in the image's alt
attribute
<img src='images/image.png' alt='My Text' />
Solution 2:
That's represented by the image's alt
attribute (which, by the way, is required):
<img src="image.jpg" alt="Alternate text for image">
And in case you're wondering, no equivalent exists for background images in CSS. There shouldn't be, anyway, since background images are purely presentational.
Post a Comment for "How Can I Make Text Behind An Image Before The Image Has Loaded?"