Don’t: bake the heading into an image
<img src="sale-banner.png" alt="Summer sale, save 40 percent">Images · Do / Don’t
Real text can reflow, zoom cleanly, adapt to user styles, be selected, translated, searched, and spoken reliably.
The principle
When the same visual presentation can be built with HTML and CSS, use real text—not pixels that look like text.
Compare
A useful alt may expose the words to a screen reader, but the pixels still cannot reflow or adapt for someone who needs larger text, different spacing, or custom colors.
<img src="sale-banner.png" alt="Summer sale, save 40 percent"><div class="sale-banner"><h2>Summer sale</h2><p>Save 40%</p></div>Exceptions
Preference for text does not prohibit every graphic containing words. It asks whether the particular presentation of those words is necessary.
Text that is part of a logo or brand name is considered essential. Give the logo an alternative that states the organization or product name.
An image of text can qualify when people can customize it to their requirements. Ordinary browser zoom alone does not make a fixed image customizable.
Decision check