byrne86 Posted November 3, 2010 Share Posted November 3, 2010 I have a main div, and 2 side divs, the right and left divs are floating left and right, and the layout is fine in Firefox and Chrome, but the side divs are pushed below the main div in IE, is there a way to fix this? Quote Link to comment https://forums.phpfreaks.com/topic/217647-floating-divs-in-ie-not-floating/ Share on other sites More sharing options...
nano Posted November 3, 2010 Share Posted November 3, 2010 With IE you usually have to set widths on the items being floated. Have you done this? Quote Link to comment https://forums.phpfreaks.com/topic/217647-floating-divs-in-ie-not-floating/#findComment-1129882 Share on other sites More sharing options...
haku Posted November 3, 2010 Share Posted November 3, 2010 If you put side margins/padding on an element with a set width, IE will render the width different from the other browsers. The secret to this is to use two divs, one inside the other. Set the width on the outer div, and the padding/margin on the inner one. This will render the same across browsers. As to how that relates to your problem, it sounds like there isn't enough space to fit both elements in IE, which means that one is bumped below to the next line. Quote Link to comment https://forums.phpfreaks.com/topic/217647-floating-divs-in-ie-not-floating/#findComment-1129957 Share on other sites More sharing options...
michaellunsford Posted November 5, 2010 Share Posted November 5, 2010 If you put side margins/padding on an element with a set width, IE will render the width different from the other browsers. The secret to this is to use two divs, one inside the other. Set the width on the outer div, and the padding/margin on the inner one. This will render the same across browsers. from the peanut gallery: Sweet! Did not know this Haku. Quote Link to comment https://forums.phpfreaks.com/topic/217647-floating-divs-in-ie-not-floating/#findComment-1130491 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.