sign in | join about | help | sitemap
Connecting Tech Pros Worldwide
anish007's Avatar

DIV container height


Question posted by: anish007 (Newbie) on August 22nd, 2008 07:20 PM
I have a problem with making div container height grow with respect to the other.

I have basically 3 div containers, the div container named main contains the other 2 containers left and right respectively. My left container floats left and my right container floats right. The right containers height changes in different pages according to content, and my left container always has the same content.
Now, how would i make my left container height grow so that it matches up with the right container, in different pages?.

Can anyone help me with this, i would really appreciate it.
Expand|Select|Wrap|Line Numbers
  1. <div id="main">
  2.        <div id="left">
  3.        </div>
  4.        <div id="right">
  5.        </div>
  6. </div>


my attributes of div containers are:
Expand|Select|Wrap|Line Numbers
  1. #main{
  2.         width: 746px;
  3.         background: #FFFFFF;
  4.         margin: 0 auto;
  5.         border: 1px solid #000000;
  6.         text-align: left; }
  7.  
  8. #left {
  9.     width: 148px;
  10.     float: left;
  11.     height: 100%;
  12.     background-color: #5A6577; }
  13. # right{
  14.     zoom: 1;
  15.     width: 595px;
  16.     float: right;
  17. }
1 Answer Posted
Dormilich's Avatar
Dormilich August 24th, 2008 09:09 AM
Expert - 596 Posts
#2: Re: DIV container height

a question, why do you need the right container? It seems that the right div contains the content, the left maybe navigation and the main container left and right div, but nothing else. Personally I'd drop the right container making the main container for the content. If you want the background color of the left container all trough to the bottom, why not using the border property of main?
Expand|Select|Wrap|Line Numbers
  1. #main{
  2.         width: 595px;
  3.         background: #FFFFFF;
  4.         margin: 0 auto;
  5.         border: 1px solid #000000;
  6.         border-left: 148px solid #5a6577
  7.         text-align: left; }
  8.  
  9. #left {
  10.     width: 148px;
  11.     margin-left: -148px; }
  12. /* another possibility to draw the div onto the border:
  13.     position: absolute;
  14.     left: -148px; */
Reply
Not the answer you were looking for? Post your question . . .
197,050 members ready to help you find a solution.
Join Bytes.com

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 197,050 network members.
Post your question now . . .
It's fast and it's free

Popular Articles

Top HTML / CSS Contributors