Explain when and how to use an alt attribute on an img tag.

Posted . Visible to the public.

Always use alt when the image needs some description for anyone who can't see it.

Use alt='' (ie, leave it blank) when the image is just being used for decoration

For images with a caption, you may still want to include alt text, since it helps search engines catalog the content of the image.

Daniel
Last edit
Daniel
Keywords
html, accessibility
Posted by Daniel to Dev (2018-10-06 08:49)