Jump to content

Fix sidebar height


BloodyMind

Recommended Posts

please I have this 2 column fixed layout from templates of the dreamweaver

 

but I want the Sidebar height to be equal to the main content's height

in other words i want it to stretch till the footer

 

here is the layout: http://www.arwebgate.com/catalyst/testimonials.html

 

CSS:

 

@charset "utf-8";
body  {
/*font: 100% Verdana, Arial, Helvetica, sans-serif;*/
font-family:Arial, Helvetica, sans-serif;
background: #666666;
margin: 0; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults */
padding: 0;
text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */
color: #000000;

}
body .p{
color:#000;
font-family:Arial, Helvetica, sans-serif;
text-align: left;
font-size: 14px;
}
#bridge-content{
width:auto;
right:inher;
position:relative;
}

#catalyst-01{
height:250px;
}

select{
width:200px;
}

#mainContent a,a:link,a:visited,a:active{
color:#00C;
border-bottom-style:solid;
border-bottom-width:thin;
text-decoration:underline;
border-bottom: 1px #FFF;
}

#mainContent a:hover  {
color: #009;
text-decoration: none;
}


/*img, a img { border: 0;}*/
img {
border:thin;
border-color:#333;
border-style:groove;
text-align: right;
}

.redTxT{
color:#F00;
font-weight:bold;
}


.p {
color:#000;
font-family:Arial, Helvetica, sans-serif;
text-align: left;
font-size: 14px;
}

.catalyst{
color:#006;
font-weight:bold;
}


#footer a,a:link,a:visited,a:active{
color:#FFF;
text-decoration: none;
font-family: Verdana, Geneva, sans-serif;
}

#footer a:hover{
color: #ccc;
border-bottom: 1px #FFF;
border-bottom-style:groove;
font-family: Verdana, Geneva, sans-serif;
}


.buttomLinks{
color:#FFF;
	font-family: Verdana, Geneva, sans-serif;
font-size: 10px;
}


.twoColFixLtHdr #container {
width: 1000px;  /* using 20px less than a full 800px width allows for browser chrome and avoids a horizontal scroll bar */
background: #FFFFFF; /* the auto margins (in conjunction with a width) center the page */
border: 1px solid #000000;
text-align: left; /* this overrides the text-align: center on the body element. */
margin-top: 0;
margin-right: auto;
margin-bottom: 0;
margin-left: auto;
} 

.twoColFixLtHdr #innerContainer{
height:auto;
margin-bottom: auto;
}

.twoColFixLtHdr #header {
background: #DDDDDD;  /* this padding matches the left alignment of the elements in the divs that appear beneath it. If an image is used in the #header instead of text, you may want to remove the padding. */
} 
.twoColFixLtHdr #header h1 {
margin: 0; /* zeroing the margin of the last element in the #header div will avoid margin collapse - an unexplainable space between divs. If the div has a border around it, this is not necessary as that also avoids the margin collapse */
padding: 10px 0; /* using padding instead of margin will allow you to keep the element away from the edges of the div */
text-align: justify;
}
.twoColFixLtHdr #mainContent h2 {
color:#006;
font-family:Arial, Helvetica, sans-serif;
letter-spacing:5;
}
.twoColFixLtHdr #sidebar1 {
float: left; /* since this element is floated, a width must be given */
width: 200px; /* the actual width of this div, in standards-compliant browsers, or standards mode in Internet Explorer will include the padding and border in addition to the width */
background: #EBEBEB; /* the background color will be displayed for the length of the content in the column, but no further */
padding: 15px 10px 15px 20px;
text-align: center;
z-index: 2;
height: 100%;

}
.twoColFixLtHdr #mainContent {
margin: 0 0 0 250px; /* the left margin on this div element creates the column down the left side of the page - no matter how much content the sidebar1 div contains, the column space will remain. You can remove this margin if you want the #mainContent div's text to fill the #sidebar1 space when the content in #sidebar1 ends. */
padding: 0 20px; /* remember that padding is the space inside the div box and margin is the space outside the div box */
margin-top: 0px;
background-image:url(images/wm.jpg);
text-align: left;
} 
.twoColFixLtHdr #footer {
padding: 0 10px 0 20px; /* this padding matches the left alignment of the elements in the divs that appear above it. */
background:#DDDDDD;
background-image: url(images/footer-bg.png);
height:auto;
z-index: 1;
} 
.twoColFixLtHdr #footer p {
margin: 0; /* zeroing the margins of the first element in the footer will avoid the possibility of margin collapse - a space between divs */
padding: 10px 0; /* padding on this element will create space, just as the the margin would have, without the margin collapse issue */
text-align: center;
color: #FFF;
}
.fltrt { /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */
float: right;
margin-left: 8px;
}
.fltlft { /* this class can be used to float an element left in your page */
float: left;
margin-right: 8px;
}
.clearfloat { /* this class should be placed on a div or break element and should be the final element before the close of a container that should fully contain a float */
clear:both;
    height:0;
    font-size: 1px;
    line-height: 0px;
}
.twoColFixLtHdr #container #mainContent h1 {
text-align: center;
color:#006;
}
.twoColFixLtHdr #container #mainContent h2 {
text-align: center;
color:#006;
letter-spacing:2;
}
.twoColFixLtHdr #topTabs #mainContent{
position:relative;
margin-left:auto;
width:600px;
height:21px;
z-index:2;
text-align: center;
background-color:#FFF;
color:#000;
font-family:Arial, Helvetica, sans-serif;
visibility: inherit;
}

 

any help would be appreciated

thanks in advance

Link to comment
Share on other sites

Hi there,

 

Wrap your sidebar and main content area div's with a third div. Most people call this third div 'wrapper'.

 

Give your wrapper the following properties:

#wrap {
    overflow: hidden; 
    width: 800px; <!--whatever this needs to be-->
}

 

You might have to adapt this a little to work for you but it is a step in the right direction.

Link to comment
Share on other sites

still didn't work :(

 

here is my new CSS:

 

@charset "utf-8";
body  {
/*font: 100% Verdana, Arial, Helvetica, sans-serif;*/
font-family:Arial, Helvetica, sans-serif;
background: #666666;
margin: 0; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults */
padding: 0;
text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */
color: #000000;

}
body .p{
color:#000;
font-family:Arial, Helvetica, sans-serif;
text-align: left;
font-size: 14px;
}
#bridge-content{
width:auto;
right:inher;
position:relative;
}

#catalyst-01{
height:250px;
}

select{
width:200px;
}



#mainContent a,a:link,a:visited,a:active{
color:#00C;
border-bottom-style:solid;
border-bottom-width:thin;
text-decoration:underline;
border-bottom: 1px #FFF;
}

#mainContent a:hover  {
color: #009;
text-decoration: none;
}


/*img, a img { border: 0;}*/
img {
border:thin;
border-color:#333;
border-style:groove;
text-align: right;
}

.redTxT{
color:#F00;
font-weight:bold;
}


.p {
color:#000;
font-family:Arial, Helvetica, sans-serif;
text-align: left;
font-size: 14px;
}

.catalyst{
color:#006;
font-weight:bold;
}


#footer a,a:link,a:visited,a:active{
color:#FFF;
text-decoration: none;
font-family: Verdana, Geneva, sans-serif;
}

#footer a:hover{
color: #ccc;
border-bottom: 1px #FFF;
border-bottom-style:groove;
font-family: Verdana, Geneva, sans-serif;
}


.buttomLinks{
color:#FFF;
	font-family: Verdana, Geneva, sans-serif;
font-size: 10px;
}


.twoColFixLtHdr #container {
width: 1000px;  /* using 20px less than a full 800px width allows for browser chrome and avoids a horizontal scroll bar */
background: #FFFFFF; /* the auto margins (in conjunction with a width) center the page */
border: 1px solid #000000;
text-align: left; /* this overrides the text-align: center on the body element. */
margin-top: 0;
margin-right: auto;
margin-bottom: 0;
margin-left: auto;
} 

.twoColFixLtHdr #sidebar1 {
float: left; /* since this element is floated, a width must be given */
width: 200px; /* the actual width of this div, in standards-compliant browsers, or standards mode in Internet Explorer will include the padding and border in addition to the width */
background: #EBEBEB; /* the background color will be displayed for the length of the content in the column, but no further */
padding: 15px 10px 15px 20px;
text-align: center;
z-index: 2;
height:100%;
}
.twoColFixLtHdr #mainContent {
margin: 0 0 0 250px; /* the left margin on this div element creates the column down the left side of the page - no matter how much content the sidebar1 div contains, the column space will remain. You can remove this margin if you want the #mainContent div's text to fill the #sidebar1 space when the content in #sidebar1 ends. */
padding: 0 10px; /* remember that padding is the space inside the div box and margin is the space outside the div box */
margin-top: 0px;
background-image:url(images/wm.jpg);
text-align: left;
} 

.twoColFixLtHdr #wrapper {
    overflow: hidden;
    width: 1000px;
margin:inherit;

}

.twoColFixLtHdr #header {
background: #DDDDDD;  /* this padding matches the left alignment of the elements in the divs that appear beneath it. If an image is used in the #header instead of text, you may want to remove the padding. */
} 
.twoColFixLtHdr #header h1 {
margin: 0; /* zeroing the margin of the last element in the #header div will avoid margin collapse - an unexplainable space between divs. If the div has a border around it, this is not necessary as that also avoids the margin collapse */
padding: 10px 0; /* using padding instead of margin will allow you to keep the element away from the edges of the div */
text-align: justify;
}
.twoColFixLtHdr #mainContent h2 {
color:#006;
font-family:Arial, Helvetica, sans-serif;
letter-spacing:5;
}
.twoColFixLtHdr #mainContent h4 {
color:#930;
font-family:Arial, Helvetica, sans-serif;
letter-spacing:5;
}

.twoColFixLtHdr #footer {
padding: 0 10px 0 20px; /* this padding matches the left alignment of the elements in the divs that appear above it. */
background:#DDDDDD;
background-image: url(images/footer-bg.png);
height:auto;
z-index: 1;
} 
.twoColFixLtHdr #footer p {
margin: 0; /* zeroing the margins of the first element in the footer will avoid the possibility of margin collapse - a space between divs */
padding: 10px 0; /* padding on this element will create space, just as the the margin would have, without the margin collapse issue */
text-align: center;
color: #FFF;
}
.fltrt { /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */
float: right;
margin-left: 8px;
}
.fltlft { /* this class can be used to float an element left in your page */
float: left;
margin-right: 8px;
}
.clearfloat { /* this class should be placed on a div or break element and should be the final element before the close of a container that should fully contain a float */
clear:both;
    height:0;
    font-size: 1px;
    line-height: 0px;
}
.twoColFixLtHdr #container #mainContent h1 {
text-align: center;
color:#006;
}
.twoColFixLtHdr #container #mainContent h2 {
text-align: center;
color:#006;
letter-spacing:2;
}
.twoColFixLtHdr #topTabs #mainContent{
position:relative;
margin-left:auto;
width:600px;
height:21px;
z-index:2;
text-align: center;
background-color:#FFF;
color:#000;
font-family:Arial, Helvetica, sans-serif;
visibility: inherit;
}

descCell{
padding:10px;
}

.filestbl{
border:thin;
border-color:#666;
border-style:solid;

}

#mainContentNoSide a,a:link,a:visited,a:active{
color:#00C;
border-bottom-style:solid;
border-bottom-width:thin;
text-decoration:underline;
border-bottom: 1px #FFF;
}

#mainContentNoSide a:hover  {
color: #009;
text-decoration: none;
}

.twoColFixLtHdr #mainContentNoSide {
 /* the left margin on this div element creates the column down the left side of the page - no matter how much content the sidebar1 div contains, the column space will remain. You can remove this margin if you want the #mainContent div's text to fill the #sidebar1 space when the content in #sidebar1 ends. */
padding: 0 20px; /* remember that padding is the space inside the div box and margin is the space outside the div box */
margin-top: 0px;
background-image:url(images/wm.jpg);
text-align: left;
} 

.twoColFixLtHdr #container #mainContentNoSide h1 {
text-align: center;
color:#006;
}
.twoColFixLtHdr #container #mainContentNoSide h2 {
text-align: center;
color:#006;
letter-spacing:2;
}
.tabPage #mainContentNoSide .tabPage ul li {
text-align: left;
}
.tabPage #mainContentNoSide .p h3 {
text-align: center;
color:#006;
}
.twoColFixLtHdr #container #mainContentNoSide h3 {
text-align: center;
color:#006;
}
.twoColFixLtHdr #container #mainContentNoSide #contact tr td u {
font-size: 18px;
}
/* ----------------------------------------------TABS STYLE ---------------------------*/
.innerContent{
padding:5px;
margin-left: 10px;
}

tabWrapper{

}

div.tabMain {
background-color: #c0c0c0;
border: 1px solid #000000;
padding: 1px;
position: relative;
z-index: 101;
width:680px;
height:inherit;
}
.tabPage{
background-color:#FFF;
width:700;
color:#000;
left:15px;
font-family:Arial, Helvetica, sans-serif;

}

div.tabArea {
font-size: 80%;
font-weight: bold;
text-align: left;
position:relative;
left:0px;

}

a.tab {
  background-color: #f0f0f0;
  border: 1px solid #000000;
  border-bottom-width: 0px;
  padding: 2px 1em 2px 1em;
  position: relative;
  text-decoration: none;
  top: -1px;
  z-index: 100;
}


a.tab, a.tab:visited {
  color: #808080 !important;
}

a.tab:hover {
background-color: #CCC;
color: #FFF !IMPORTANT;
}

a.tab.activeTab, a.tab.activeTab:hover, a.tab.activeTab:visited {
  background-color: #c0c0c0 !important;
  color: #000000;
  z-index: 102;
}



.tabMain iframe {
text-align: center;
}


div.tabMain {
background-color: #c0c0c0;
border: 1px solid #000000;
padding: 1em;

}

div.tabIframeWrapper {
  width: 100%;

}

iframe.tabContent {
background-color: #FFF;
border: 1px solid #000000;
width: 100%;
}
.tabPage #mainContent .tabPage ul li {
text-align: left;
}
.tabPage #mainContent .p h3 {
text-align: center;
color:#006;
}
.twoColFixLtHdr #container #mainContent h3 {
text-align: center;
color:#006;
}
.twoColFixLtHdr #container #mainContent #contact tr td u {
font-size: 18px;
}
#contactForm {
position:inherit;
}.contacts {
font-family: Arial, Helvetica, sans-serif;
color: #009;
}
.textJustify {
text-align: justify;
}

Link to comment
Share on other sites

You cannot get auto, equal height boxes in css (there are tricks to do it in modern browsers but, of course, NOT in any IE).  The columns will only stretch to accommodate the content within. Using empty paragraphs will not work for all browsers, monitors and resolutions ... the columns will eventually blow up in one or another.

 

You need to use a brilliant technique by Dan Cederholm (author of Bullet Proof Web Design) called "faux columns".

 

Here is the link to the original article and examples of how to use it (follow it, learn it and bookmark it until you have it down ... it is a must for any css based wire layout):

 

http://www.alistapart.com/articles/fauxcolumns/

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.