Jump to content


Photo

[SOLVED] Need help placing divs...


  • Please log in to reply
2 replies to this topic

#1 DaveLinger

DaveLinger
  • Members
  • PipPipPip
  • Advanced Member
  • 268 posts
  • LocationWV, USA

Posted 01 October 2006 - 04:38 AM

So I'm currently in the stage of moving all of my old table driven layout stuff to divs. I have the basic jist of it, I think, but I have one problem so far. If I have 2 objects set up like this...

<div id="web_sites">Stuff</div>
<iframe id="web_window" frameborder="0">Other stuff</iframe>

CSS:

#web_sites {
 	border:1px solid #ccc;
 	padding:3px;
 	align:left;
	width:150px;
	height:210px;
	}
#web_window {
 	position: relative; top: -218px; left: 157px;
 	border:1px solid #ccc;
  	align:right;
	width:532px;
	height:600px;
	}

That does what I want it to do. I want the "web_sites" div on the left, and the "web_window" on the right. The only problem is that it leaves the white space where the "web_window" WOULD HAVE BEEN if I hadn't moved it, making my page longer than it needs to be. Here's the link: http://www.davelinge...m/web/index.php

Thanks!
http://www.DaveLinger.com
dave at linger dot com

#2 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 01 October 2006 - 01:49 PM

Dont use positioning. Learn to use float.

Basically remove any positioning you have. The float #web_sites and #web_window left:
#web_sites, #web_window {
  float: left;
}

Now you want to clear the floats by adding clear: both to #footer

#3 DaveLinger

DaveLinger
  • Members
  • PipPipPip
  • Advanced Member
  • 268 posts
  • LocationWV, USA

Posted 01 October 2006 - 08:10 PM

works great, thanks. :D
http://www.DaveLinger.com
dave at linger dot com




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users