Topic: Balancing Columns Using DIV's (Page 1 of 1) |
|
---|---|
Nervous Wreck (II) Inmate From: Dublin, Ireland |
posted 02-09-2005 18:52
I'm hoping someone can help me with the following: I have a fairly standard looking page layout - a sidebar DIV and a main content DIV contained within a wrapper DIV to center them on the page, all followed by a footer DIV which spans the whole page. The main content DIV has a border defined down the left side to separate it from the sidebar - the resultant page looks like this. Just what I want. The problem occurs when the mian content is shorter than the sidebar - in that case the page looks like this. As you can see, the separating border only goes to the end of the main content DIV, not all the way to the footer. Can anyone tell me if it's possible to force the main content DIV to be at least as long as the sidebar? The CSS I'm using is as follows: |
Maniac (V) Mad Scientist From: :morF |
posted 02-09-2005 20:20
Well, one possiblity is to place the sidebar DIV inside the main content DIV. Then if the text overflows the minimum size of the sidebar DIV that DIV will stretch, taking the main content DIV with it, then you define your right border on the sidebar DIV instead of left border on the main. Other than that without changing your markup the only way to 'force' two DIVs to be the same size is using javascript to either change the size of one to match the other or to use javascirpt ot alter the stlyes, giving whichever one is longer the border. |
Bipolar (III) Inmate From: I come from the land down under. |
posted 02-10-2005 03:35
I have found when creating a web page that the CSS coding can often cause the page to go everywhere. Try making the sidebar an absolute and not float it. it may help with this problem |
Paranoid (IV) Inmate From: Mesquite, TX 75149 |
posted 02-10-2005 05:33
Well this is not possible how you have it to my understanding. The content will only start to expand once it is passed the viewport (what you see before scrolling). There is a way around it that is a little more complicated..but can be done =D |
Nervous Wreck (II) Inmate From: Dublin, Ireland |
posted 02-10-2005 14:06
Thanks for all the suggestions. In the end, the quickest and easiest way turned out to be putting a background image in the wrapper - thanks Shifter! It's not ideal, because I'll have to edit the background image if the width of the sidebar changes, but it will do until I have time to try the other solutions. |