Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

IE7 Float Bug With Percentage Width?

2 views
Skip to first unread message

dhtmlk...@gmail.com

unread,
Dec 1, 2007, 1:40:16 AM12/1/07
to
Hi,

If I have 5 blocks, each float: left, each width 20%, then why does
IE7 put the last one on the next line?

http://dhtmlkitchen.com/test/bug/float-bug.html

Garrett

BootNic

unread,
Dec 1, 2007, 1:18:16 PM12/1/07
to
"dhtmlk...@gmail.com" <dhtmlk...@gmail.com> wrote:
news:964f8d36-ab37-4d8c...@a39g2000pre.googlegroups.com:

You set a width of 763px for which 20% does not give a whole number, and
now the UA decides what to do with it.

763/5=152.6

IE rounds it up to 153 and that makes the UL 2px too narrow and so the
float goes to then next line.

FF sets the width to 152.533 which adds up to 762.655. With the aid of a
special background image, it appears that FF alternates the width of the
elements something like 153 152 153 152 153 for a grand total of 763.

Others round it down to 152, which if you give the UL a background-color
you see just a wee bit of it.

I would set the width of the UL to 170px or 175px in an attempt to avoid
the issue.

--
BootNic Saturday December 1, 2007 1:18 PM
Our earth is degenerate in these latter days; bribery and corruption
are common; children no longer obey their parents; and the end of the
world is evidently approaching.
*Assyrian clay tablet 2800 B.C.*

BootNic

unread,
Dec 1, 2007, 9:03:40 PM12/1/07
to
BootNic <b00...@yahoo.com> wrote: news:Xns99F9875A61AE6BootNic@
85.214.90.236:

[snip]


> I would set the width of the UL to 170px or 175px in an attempt to avoid
> the issue.

I have no ideal where I got 170px and 175px. What it should be is 760px or
765px.

--
BootNic Saturday December 1, 2007 9:03 PM
"Do not trust your memory; it is a net full of holes; the most
beautiful prizes slip through it."
*Georges Duhamel, The Heart's Domain*

0 new messages