Jump to content

Archived

This topic is now archived and is closed to further replies.

DaveLinger

[SOLVED] Need help placing divs...

Recommended Posts

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...

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

CSS:

[code]#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;
}[/code]

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.davelinger.com/web/index.php

Thanks!

Share this post


Link to post
Share on other sites
Dont use positioning. Learn to use float.

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

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

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.