Browse Archive

Newsletter

Please enter your e-mail address to subscribe to our newsletter.

Breaking news

2009-02-23 18:24 by Helen Lewis

Free web hosting

Sign up for a web design package today and get one year free hosting.

Read more …

Events

< September 2010 >
Mo Tu We Th Fr Sa Su
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30      

Fixing the double float margin bug

2009-01-24 17:32 by James Wilson

How to fix the Internet Explorer double float margin bug

The IE double float margin bug shows up in practically every floated CSS layout. If there is a floating element with a margin value, its margin will be doubled in IE6. To fix this behaviour, simply set the floated element's display property to inline. Here is a short example that uses the "Star HTML Hack":

#element {
float:left; margin:10px;
}
* html #element {
display:inline; /* IE only */
}

Go back

Add a comment