Need 2 col layout where BOTH columns have min height and BOTH columns expand when content expands
Posted: 15 October 2007 05:33 PM   [ Ignore ]
Newbie
Rank
Total Posts:  1
Joined  2007-10-15

Hi,
I am make a site with a 2 column layout where the left column is for the menu (vertically stacked) and the right side has the content.

What I need is the CSS for this 2 column layout such that:
1) Cross browser (FireFox 2 and IE 6)
2) BOTH columns to be at least 500px in height, but if the content in the right column expands beyond that height… .then I want both, yest both columns to expand - not just the right column with the content, but BOTH columns must expand when the content extends over 500px. I want the columns to be/look symmetrical.
3) No ‘faux’ columns please - the left and right columns will have a different background color than the background of the page itself.

I’ve tried a dozen examples from web sites… but NONE of them WORK Here’s where I’m at now:
http://www.alexwenttochina.info/template.php  and/or
http://www.alexwenttochina.info/template.html
(I apologize for posting a link - but this is the easiest way to show what I have and what I want)

I am ‘close’..... but I can’t get BOTH columns to expand when the right column, which contains the dynamic content that may expand past the minimum height.

I can’t tell how frustrating this is…..Arrrrggggh (and I’m not even a pirate or anything) - it seems it takes more ‘work-arounds’ to do something in CSS and it doesn’t even really work.

The CSS that controls my column layout for my http://www.alexwenttochina.info/template.html is:

body{
    background
#32331c;
}

#left {
margin-left5px;
width200px;
background#a2c4ca;
}

#right {
width600px;
background:#cae688;
colorblack;
}

.col {
float
left;
min-height500px;
heightauto !important;
height500px;
}

.clear {
clear
both;
}


#footer{ /*not used */
    
margin-left40px;
    
text-aligncenter;
    
border-bottomthin solid #99CC33;

The CSS that controls my column layout for my http://www.alexwenttochina.info/template.php is:

body{
    background
#32331c;
}

#wrapper
{
    width
790px;
    
margin0 auto;
    
height100%;

}

#left
{
    width
220px;
    
floatleft;
    
height500px;
    
background#a2c4ca;
    
background-imageurl(../images/peace.gif); 
}

.left-container
{
    margin
10px;
    
margin-bottom0;    /* IE6 pushes footer down without this */
}

#right
{
    width
680px;
    
background:#cae688;
    
floatleft;
    
height500px;
}

.right-container
{
    margin
20px;
    
margin-bottom0;    /* IE6 pushes footer down without this */
}

.clear
{
    clear
left;

I do understand a little CSS, but not much. So any help would be GREATLY appreciated!! I mean if you really know who to make a 2 column layout where BOTH columns have a minimum height, and BOTH columns will expand when the right column extends past this minimum…..PLEASE help!!!

Thanks
Vmusic

Profile
 
 
Posted: 19 November 2007 01:20 PM   [ Ignore ]   [ # 1 ]
Member
Avatar
RankRankRank
Total Posts:  52
Joined  2007-11-08

You’ll have to do it the way its supposed to be done..keep it simple and don’t waste your time making your css bulky with all types of workarounds and scripts..Use a table with 2 columns, and put your presentational data in your stylesheet. XHTML doesn’t mean you don’t use tables anymore. It just means you should do it the right way..

Profile
 
 
Posted: 19 November 2007 05:24 PM   [ Ignore ]   [ # 2 ]
Newbie
Rank
Total Posts:  9
Joined  2007-11-12

IE 6 is not going to understand your min-height.  What you could do is write a conditional statement for IE6.  It will not allow for min-height to work but you could at least achieve the layout you wanted in the other browsers and when it comes to IE6 you give it a conditional statement of a fixed-height so that it looks decent also.

<!--[if IE 6]>
<
link rel="stylesheet" href="styles/stylesheet_ie_6.css" type="text/css" />
<!
[endif]--> 
Profile
 
 
Posted: 01 March 2008 03:04 PM   [ Ignore ]   [ # 3 ]
Newbie
Rank
Total Posts:  5
Joined  2008-02-29

I’ve tried a conditional IE statement just like this but when I test IE6 it doesn’t seem to load the alternate .css. This would be the perfect solution in this case too. Is there something else you need to get the conditional IE statement to go?

Profile
 
 
Posted: 01 March 2008 03:12 PM   [ Ignore ]   [ # 4 ]
Newbie
Rank
Total Posts:  9
Joined  2007-11-12

can you post an url for the site?

Profile
 
 
Posted: 01 March 2008 03:24 PM   [ Ignore ]   [ # 5 ]
Newbie
Rank
Total Posts:  9
Joined  2007-11-12

I also found this great article on conditional statements.

http://reference.sitepoint.com/css/conditionalcomments

Profile
 
 
Posted: 01 March 2008 08:22 PM   [ Ignore ]   [ # 6 ]
Newbie
Rank
Total Posts:  5
Joined  2008-02-29

Sorry! I should have posted it the first time! Thanks for asking! I can’t seem to get my site to redirect IE 6 and 5.5 to my alternate .CSS file. They just never load it. I am a little new to CSS. Can’t I somehow enter my alternate element styles for IE 6 and 5.5 within my main style sheet with “*” ?

Here is what I have in the head section of my index.asp :

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
>
<
html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">

<
head>



<
link rel="stylesheet" href="tex.css" type="text/css"/>

<!--
[if lt IE 7]>
<
link rel="stylesheet" type="text/css" href="ietex.css"/>
<!
[endif]-->

</
head

Is this correct? I’ve tried so many combinations of that. I tested the site on IE6 and it never loads “ietex.css”. The site is http://www.readingnowerie.com and the main style sheet is “tex.css” at the root. What am I doing wrong? I’ll check the site you sent. Thanks!

Profile