redbullmarky Posted October 26, 2006 Share Posted October 26, 2006 Hi allAnyone have any idea why some browsers create a huge gap underneath floats when using either <div> or <br /> styled with clear:both, and how to avoid it? it normally happens within a DIV that has a margin of, say, 200px to allow for a left-floated menu that sits outside of it. when i remove the menu, and the margin, the problem goes away.cheersMark Link to comment https://forums.phpfreaks.com/topic/25155-general-question-about-clearboth/ Share on other sites More sharing options...
wildteen88 Posted October 26, 2006 Share Posted October 26, 2006 If you use margin: 200px then its going to add a 200px margin on all sides and thus you get a gap when your use clear:both. Just apply the margin/padding to the side you want it on:margin-left: 200pxOr float the left and right elements to the left then you don't need to worry about adding margins to position the element on the right. The elements will but-up-against each other. Link to comment https://forums.phpfreaks.com/topic/25155-general-question-about-clearboth/#findComment-114943 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.