[thelist] cause of this 2px space? (follow up)

Andrew Clover and at doxdesk.com
Fri Apr 19 05:38:00 CDT 2002


Marc Seyon <seyon at delime.com> wrote:

> If you look at the right side of the blue bar at top, IE and Opera
> apparently place the image 2 pixels away from the edge of the div,
> causing the background colour to be visible.

Aye. You'll love this - it's caused by the default value for the
non-standard HTML attribute 'hspace' on floated images. Which is not
overridable from CSS in IE/Win. Either include 'hspace="0"' on the
image (in which case you can kiss your validation goodbye), or -

 - put the img inside a CSS floating div instead of floating the
   img itself (divs are unaffected by hspace); give the img
   'display: block' so it doesn't align to text baseline in
   Mozilla; or
 - since the block is already right-aligned anyway, just put the
   image after the text, non-floated, using 'vertical-align: top'
   to get it off the baseline.

--
Andrew Clover
mailto:and at doxdesk.com
http://and.doxdesk.com/



More information about the thelist mailing list