You’re viewing an archive of outdated material. Visit The Web Standards Project’s updated site to learn about our current mission.

Problems setting padding on Images

When the padding is set on an image when images are disabled, the image is incorrectly moved up the page, causing text to be overwritten. This page contains the following stylesheet:

     IMG { padding-top: 30px; }

There now follows a filler paragraph, followed by an image.

This is the filler paragraph. This is the filler paragraph. This is the filler paragraph.

This should be displayed *after* the filling paragraph, *not* on top of it. There should be a 20 pixel gap between the top of this image and the bottom of the filler paragraph.

(There is actually another issue here. Technically speaking, the alt text of an IMG element should be rendered in the flow of text. It is a replacement for the image, not merely a textual description that should be rendered where the image would be.)