2 replies [Last post]
user3344
Offline
newbie
Last seen: 15 years 25 weeks ago
Timezone: GMT+2
Joined: 2007-04-14
Posts: 2
Points: 0

Hi, I have a problem with IE 6 when I try to clear a float:right. If the float is taller (try resizing) then the surrounding text the margin of the parent element turns into padding.
I'm not sure whats causing this or how to fix it, FF seems to work fine and the code validates.
Can you provide some pointers please?

test

p {margin:0}
body {background-color:#333;color:#fff;}
#page {background-color:#00f;color:#333;margin:50px;padding:10px;}
#main {background-color:#0f0;color:#000;}
#content {background-color:#fff;color:#000;}
#float {float:right;background-color:#f00;color:#000;margin:5px;}
#clear {background-color:#ccc;color:#000;clear:both;}

float

float

blah blah blah blah blah blah blah blah blah blah blah blah blah

clear

DanA
DanA's picture
Offline
Elder
Last seen: 12 years 21 weeks ago
Timezone: GMT+2
Joined: 2004-08-14
Posts: 1087
Points: 2

Add height:1%; in #main to

Add height:1%; in #main to set hasLayout.
http://www.satzansatz.de/cssd/onhavinglayout.html

user3344
Offline
newbie
Last seen: 15 years 25 weeks ago
Timezone: GMT+2
Joined: 2007-04-14
Posts: 2
Points: 0

Thank you.

Thank you.