Return to Snippet

Revision: 7108
at July 7, 2008 06:53 by Uzbekjon


Initial Code
/*
   Instead of this
*/
#content {
	float: left;
	width: 500px;
	padding: 10px 15px;
	margin-left: 20px;
}

/*
   Do this
*/
#content {
    float: left;
    width: 500px;
    padding: 10px 15px;
    margin-left: 20px;
    display:inline;
}

Initial URL

                                

Initial Description
It’s an Internet Explorer-exclusive bug wherein an element that is floated – and given a margin in the same direction as the float – ends up with twice the specified margin size. The fix is extremely simple. All you have to do is apply a display: inline rule to your floated element.

Initial Title
Bug Fix: IE Double Margin Float Bug

Initial Tags
css, ie

Initial Language
CSS