Click to See Complete Forum and Search --> : Relative positioning


doyle_loader
05-26-2005, 12:27 PM
I was just wondering if it's possible to make one div's positioning relative to another div's positioning. The situation I am trying to do is have a css page with a header, 3 columns (the middle with 100% height and width) and footer. I am doing some testing but I get into the problem of one div running over another div.

I am new to CSS and am trying to learn it. Answering this question will help me out a lot!

Thanks,

Chris

Mr J
05-26-2005, 03:06 PM
Here is a simple example


<div style="width:300px;height:200px;background-color:#CCCCCC"></div>
<div style="position:relative;left:100px;top:100px;width:300px;height:200px;background-color:#EEEEEE">I am positioned relative to the above div</div>

doyle_loader
05-26-2005, 05:39 PM
But will the first div expand 100% height and width? I don't see it in the code anywhere.

Thanks

Chris

Mr J
05-26-2005, 06:03 PM
Post the code you are using because you are not explaining clearly enough.

The situation I am trying to do is have a css page with a header, 3 columns (the middle with 100% height and width) and footer. I am doing some testing but I get into the problem of one div running over another div.

You don't say which div is running over another?

If you are having 3 columns with the middle one at a width and height of 100%

100% of what?

If it is 100% of the available document size then where are the other 2 columns going to be positioned?

doyle_loader
05-26-2005, 07:00 PM
http://www.k12.nf.ca/hcch/New%20Website/ is the website. Hopefully that will help a bit. :)

The middle "content" div (called iframe) runs over the footer div's when it's set to 100% height and over the right column with the "content" div is set to 100% width.

I want the document to be 100% of user's screen resolution so it will be able to resize to fill the screens of different users.

When I set the "content" div to 100% height, for example, it would run over the footer section.

I was thinking there probably was a way to set the position of the footer div's to be realtive the "content" div. But as I said, I am new to this and I am finding it a bit hard to grasp my head around the idea.

Thanks.

Chris