Make a div stick with the higher one

Hi,

under Joomla, i have 5 divs.

  • 1 on the top for main menu and banners
  • 1 on the left for my menu category,
  • 1 central for the content
  • 1 on the right for ads.
  • and 1 as footer

as my content div heigh changes during the web browsing, i would like to make my left div (category menu) still reaching my footer div.
this is needed because my left div as for background-color a different color than the content one.

how can i do to make the left div everytime reaching the footer one even if my content div heigh is changing ?

thanks a lot,
A.

Hi,
The easiest way to make Equal Height Columns with CSS is to use the [URL=“http://www.css-lab.com/demos/2col/2col-faux.html”]Faux Columns Method.

It just simply uses a repeating BG image on the main wrapper. The image can be designed to do more than one column.

You can also do it by setting a BG color on the main wrapping div for the left and right columns as well as using a repeating image for one of the columns. When using this method the side columns are shifted out of the inner wrapping div with negative margins.

Three Equal Column with min-max wrapper
Three Equal Column with Content first in source order

The expander links are just for demo purposes only :slight_smile:

They are there to show you that all other columns expand along with whichever expander link you hover on.
They just simulate dynamic content being placed in the columns.

You can also see the columns expand by using “zoom text only”.

unfortunately while i was checking the code, the expanded link display a block of a fixed-height…in my case i do not know the height of the content div to which my left div must be aligned (in height) :sick:

I checked the code on http://www.pmob.co.uk/pob/equal-columns.htm without image.
it’s interesting but in my case it means to change my template from Joomla. :frowning: as the floating div must be a child of the content div :frowning:
so in my case the left div (where is the menu) should be a child of my content div (where is displayed all article and goods from my joomla website.

Thanks for the welcome! Good to be here!

I’m glad you piped up- I don’t currently have any jump links on my site which explains my ignorance, but this is great to know. I’m quite new to this, but I like to do things the “right” way as much as possible. I guess I’ll changing my site to faux columns now :frowning: It’s seems crazy that there’s no better way to do this!

Hi Derlin, Welcome to SitePoint! :slight_smile:

That equal column method you are referring to comes from the “One True Layout”.

The reason we don’t suggest using it is because there are [URL=“http://www.positioniseverything.net/articles/onetruelayout/appendix/equalheightproblems”]several known issues with it.

The biggest problem with it is linking to anchors in elements within the containing block (using jump links within the page, also known as fragment identifiers).

positioniseverything.net
Linking to an anchor in any of the columns within the element that has been set to overflow: hidden causes the content of that column to shift upwards. In IE and Firefox, that is.
View this test case in IE or FF and then view it in Opera. You will see that IE and FF no longer allow you to scroll back to the top of the page since the content shifted up.

If you are not planning on using any jump links then the method does work but that one bug is enough to cause most people to abandon the method altogether.

I recently solved this problem in a way that might work for you.

Set overflow:hidden on your containing div, then set the left column to padding-bottom:2000px; and margin-bottom:-2000px; This puts the bottom of the div where it would normally be and shouldn’t expand the container div. But it should extend the background image/background color far below the bottom of the container (to the footer div).

I’m fairly new to css, so forgive me if there is some flaw here. But this method seems to be working great for me.