CodePark/ questions / Semantic HTML
START PRACTICINGPRACTICE
Frontend question · CSS & HTML › Semantic HTML

An img is purely decorative (a background swirl next to a heading). What is the correct markup?

alt=""

alt="" is right. An empty alt tells assistive technology, such as a screen reader, to skip the image. That is what you want for pure decoration.

Leaving
alt out entirely is the tempting wrong answer, and it is worse. Many screen readers then read out the file name instead. Filler text like alt="decorative image" or alt="swirl.png" is also wrong, because it adds noise and gives no useful information.