.
WTF? - Grin with cat attached
Previous Entry Next Entry
WTF? Apr. 7th, 2004 03:11 pm
CSS misbehaviour that's just Far Too Weird for parsingphase (although I may document any solutions there later).

I have an XHTML 1.1 file. It has a div that's 145 px wide. This div contains a number of images, 145x22px, with no text or anything else in the div. So, the images stack one on top of each other.

With vertical gaps between them. They are styled 'border:0; padding: 0; margin: 0'. And there's gaps between them.

How do I fix this? I set font-size: 2px on the enclosing div. Please don't ask me why the hell I decided to do that, but it works.

WHY?

WTF is going on here!?!?

(no subject) - (Anonymous)
(no subject) - (Anonymous)
From: wechsler
Date: April 7th, 2004 - 07:27 am (Link)
running the images into each other will also sort it (ie without HTML-code whitespace)

It didn't - tried that one first.
From: wechsler
Date: April 7th, 2004 - 07:30 am (Link)
Only an absolute fontsize of 1 or 2px fixes it. Making the div wider to allow for the space would, I assume, leave room for the space to go on the same line, but it appears not to.
From: deliberateblank
Date: April 7th, 2004 - 08:09 am (Link)
Are your imgs block or inline formatted? If block then any surrounding text isn't allowed to share their line.

(Do you have an example up somewhere?)
From: wechsler
Date: April 7th, 2004 - 12:26 pm (Link)
Inline - but the code's gone out now (bloody rush jobs) and can't be shown publically, so I shall revisit the problem at a later date.