How long or detailed should our alternative text be?


#1

Question

How long or detailed should our alternative text be?

Answer

Alt attributes should be accurate and as sufficient as possible. Usually, a few words will be descriptive enough but occasionally a sentence or two will be more appropriate.

For more information on how to create great alternative text, take a look at these examples.


FAQ: Learn HTML Elements - Intro to HTML - Image Alts
#2

Does it always have to be double quotes when we are writing anything inside a tag, can we use single quotes as well?


#3

The general practice is double quotes when we hand write the code, but when generating code the circumstances will dictate. Personally, I always use double quotes on attributes and generate HTML strings with single quotes.

'<div class="something">content</div>'

or,

`<div class="${classname}">${content}</div>`