Jump to content

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
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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