Jump to content


Photo

positioning and float problem


  • Please log in to reply
1 reply to this topic

#1 tjhilder

tjhilder
  • Members
  • PipPipPip
  • Advanced Member
  • 136 posts
  • LocationKent, UK

Posted 30 June 2006 - 08:35 PM

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

#2 nogray

nogray
  • Members
  • PipPipPip
  • Advanced Member
  • 930 posts
  • LocationSan Francisco CA

Posted 30 June 2006 - 08:52 PM

If you want IE to center you div by using the margins, you need to include the document declartion

<!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">

If you floating HTML elements, you'll need to clear them before closing the holding div

So, something like this in the style
.clear_float {clear:both;
height:1px;
overflow:hidden;

and you middel section will look like this
<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">&nbsp;</div>
	</div>


NoGray.com





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users