Link to home
Start Free TrialLog in
Avatar of ee-itpro
ee-itpro

asked on

Auto Adjust height of column on right

Hi

   Please take a look here -  http://tinyurl.com/cityads


I want the column on right that has the search box  to auto adjust itself to be of the same height as the content column on left.


So if the height of the column on left increases or decreases the right column should adjust itself to the same height so both of them are at the same level from top to bottom and the page looks good.


How can i do this?
Avatar of rsmithnt
rsmithnt
Flag of Canada image

I would use something like jquery
You can do this in a variety of ways. Are you opposed to Jquery/Javascript or do you want a pure CSS solution?
Avatar of ee-itpro
ee-itpro

ASKER

Not opposed to jquery but would prefer a css solution
The link for css does not have the code, it only shows what the end result looks like
View the source:


div.eW { overflow:hidden; }
div.eW.eB { height:1px; font-size:0; }
div.eW div.eH { float:left; width:30%; background-color:#9F0; margin-right:5px; padding:10px; padding-bottom:9010px; margin-bottom:-9000px; border:1px solid #000; }

Open in new window

What browser are you programming for.  Sometimes a css solution may not be compatible with the browser.
I just noticed your using a strict Doctype. In the link I provided he's using a transitional. This will also effect the way the browser interprets the CSS.  We may want to look at the Jquery/JS solution.
$('#right_content').height($('#left_content_middle').height());

using jquery
I am looking at cross browser support mainly FF, Ie, Chrome ... support for older versions of these browsers as well(ie 6 as well if possible)


I'm not proficient with css, so can you please explain me how that css code that you provided works


Are these 3 different divs , the last 2 inheriting any properties from the first one?

div.eW

div.eW.eB

div.eW div.eH


I'd look at Jquery but if the Javascript support is turned off for the browser it won't work.
If JS is turned off on the browser, they probably won't be browsing your site anyways. Better than 90% of users have JS on with some protection on the OS or browser side of things.

To answer your question though what they are doing is using a large amount of padding-bottom as well as margin-bottom. (the same amount actually).  Then your parent div, will have overflow:hidden to hide anything that won't have actual content.
LZ1 is correct.  In my opinion jquery is your best cross browser solution.
ASKER CERTIFIED SOLUTION
Avatar of LZ1
LZ1
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks,  i'll try out the above stuff and let you people know how it goes