Checking HTML with a Validator
A browser will often display a page even when some of its markup is malformed. That makes visual testing a poor way to tell whether the source is sound. An HTML validator gives you a second check.
Try it with a small HTML 4.01 page. Put an image on the page and leave out its alt attribute. Paste the document into the W3C markup validator using direct input. Find the diagnostic for the image, add a description, and run the check again. For a purely decorative image, try an empty value, alt="".
Read the first diagnostic before trying to fix every item on the list. An unclosed tag or a missing quote can cause the validator to misread the next several lines. Fix the earliest problem and see which of the later messages disappear.