jQuery: Fix IE6 Double Margin bug

Fix IE6 Double Margin bug

Author: Alessandro Coscia

The problem

IE6 is famous for its 'ie6 double margin bug'.
It occurs when you use float boxes. In certain cases the margin will redouble.

You can find more info about this bug to Position is Everything.

Solutions

There are several solutions:
  • Hack one-half margin value for IE/win only
  • Set display: inline
  • Use jquery.fixDoubleMargin.js (compatible with prototype, mootools and scriptaculous!!!)


Solution: Use jquery.fixDoubleMargin.js

I wrote this plugin to solve this problem.
It is very simple to use: include the libraries between <head> and </head>:

and then put this code after:

Downloads

jQuery

jQuery
Fix IE6 Double Margin bug
Fix Box model bug
Usefull plugin to solve some CSS problems.