May 20, 200917 yr Hi!! As per the title topic, i have got 2 floating <div>'s 1 of them is floating to the left, and the other is floating to the right. The <div> floating to the right has got more content than the <div> floating to the left. The <div> floating to the right stick to the top of the footer, the left floating <div> has a gap between it and the top of the footer meaning that you are able to see the background. How do i make the 2 <div> stick to the top of the footer? Thanks Tyler
May 20, 200917 yr Author Hopefully someone can help me I gota show the finished site to the client at 11am TODAY LOL
May 20, 200917 yr For the sake of a quick fix just give your left div a height so as to fill the gap, then have a look at faux columns. http://dustinbrewer.com/using-faux-columns...-column-height/ Pat
May 20, 200917 yr wrap them both in a div e.g. div class="container" .container {background:#fff;float:left;} if the float ends up breaking your layout then use this instead: .container {background:#fff;overflow:visible;}
May 20, 200917 yr Author Thank guys! Next problem i have, is in IE, the the left floating <div> sticks to the top as i want, but the right floating <div> goes below the other one but still on the left hand side.
May 20, 200917 yr What about if you give your content wraping div a white background the gaps wont show up as badly?? just going by the photo above?? Hope it helps.
May 20, 200917 yr Author What about if you give your content wraping div a white background the gaps wont show up as badly?? just going by the photo above?? Hope it helps. I have the first problem solved lol re-read my post above for my new problem lol
May 20, 200917 yr So you mean it does something like this? .....[c2] [c1]..... Where as you want [c1][c2] Got a link? If a float is forced down, it tends to be a box model issue that causes this (i.e to wide to fit in the allocated space, so it shoves one down below).
May 20, 200917 yr I have the first problem solved lol re-read my post above for my new problem lol Sorry skim reading not paying attention! Same as bocaj need a link or some code I think. so the right float is on the left only in IE??
May 20, 200917 yr Author Sorry skim reading not paying attention! Same as bocaj need a link or some code I think. so the right float is on the left only in IE?? Yeah exactly!! Its works perfect in firefox, but as per usual not in IE link http://www.drumcornfarmcottage.co.uk/pricing.html
May 20, 200917 yr Apply overflow: hidden; to both floats, IE5 & 6 has an issue that occurs when using xhtml, in that some elements that use indented code it creates extra spacing (mis-interprtation of white space?). Applying overflow:hidden; to both floats will fix it. I don't know what side effects this may have with other browsers, so you can always wrap it in a conditional comment for any ie's less than ie7 This fix will only work if the required dimensions have been specified. Your issue lies with the left and right side, so a width must be specified (which you've done, so it's fine). The same fix will work for top and bottom too, but only when a height is specified.
May 20, 200917 yr Quick CSS hack to apply what bocaj said just to IE6: * html #main-content, * html #main-sidebar {overflow:hidden;} Just add to end of CSS file
May 21, 200917 yr If you are still having problems try this: #footer {clear:both} then of course make the div id of the footer, footer <div id="footer"></div>
Create an account or sign in to comment