Jump to content

[SOLVED] Need help placing divs...


DaveLinger

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!
Link to comment
https://forums.phpfreaks.com/topic/22637-solved-need-help-placing-divs/
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

Archived

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

×
×
  • Create New...

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.