tjhilder Posted June 30, 2006 Share Posted June 30, 2006 Hi,I'm having some trouble with css positioning, basicly I have bunch of div tags, some inside each other, I go to center them (and also float) but by doing that, my main div (the one that the others are all in) will only include the ones that don't have float : left; in them, and plus on IE it's now not centering (FF is fine with it).the link is below:http://www.tjhilder.co.uk/new/test.php(just click view source to see both the html and css.if you can help me out, thanks a lot.TJ Quote Link to comment https://forums.phpfreaks.com/topic/13336-positioning-and-float-problem/ Share on other sites More sharing options...
nogray Posted June 30, 2006 Share Posted June 30, 2006 If you want IE to center you div by using the margins, you need to include the document declartion[code]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">[/code]If you floating HTML elements, you'll need to clear them before closing the holding divSo, something like this in the style[code].clear_float {clear:both;height:1px;overflow:hidden;[/code]and you middel section will look like this[code]<div id="middle"> middle <div id="middle-top"> middle top </div> <div id="left"> left </div> <div id="right"> right </div> <div class="clear_float"> </div> </div>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/13336-positioning-and-float-problem/#findComment-51437 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.