Bjørn Enki’s web design blog

Internet Explorer 6 double margin bug fix on floated elements

Internet Explorer 6 (IE6) effectively doubles margin values on floated elements. As a work-around to this bug, simply add "display:inline" to the floated element with the margin.


Warning: mktime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /chroot/home/bjorn/bjornenki.com/html/includes/blog-functions.php on line 20

Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /chroot/home/bjorn/bjornenki.com/html/includes/blog-functions.php on line 20

Warning: mktime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /chroot/home/bjorn/bjornenki.com/html/includes/blog-functions.php on line 22

Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /chroot/home/bjorn/bjornenki.com/html/includes/blog-functions.php on line 22

Internet Explorer 6 double margin bug fix on floated elements

This is mostly for future reference in case I forget, but I'm sure there's someone else out there who will be searching for a solution to the "double margin" bug in Internet Explorer 6 (IE6). 

All you need to do is add "display:inline" to the floated element with the margin that is getting doubled.

There's also a JavaScript solution, but I would personally rather just add a CSS rule for Internet Explorer 6 (until the old browser finally dies out).

Posted Jun. 5, 2009 at 7:22 pm under: website development, css, web browsers, ie6

Leave a response!