What alt text is for
Alt text describes an image for people who cannot see it, read aloud by screen readers. Search engines also use it to understand images, which matters for image search.
Decorative images, like background flourishes, should have an empty alt attribute (alt="") so screen readers skip them. A missing alt attribute is different: screen readers may read the file name instead.
Questions
What makes good alt text?
A short, specific description of what the image shows and why it is there, such as Dashboard showing weekly signups. Skip phrases like image of.
Is an empty alt attribute an error?
Not for decorative images; it tells assistive tech to skip them. It is an error for images that carry meaning.
Should I put keywords in alt text?
Only when they describe the image. Stuffing alt text with keywords hurts accessibility and can look spammy.
Does it check images in CSS?
No. Background images set in CSS have no alt text; only img elements are checked.