473,411 Members | 1,899 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,411 software developers and data experts.

DIV container height

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. }
Aug 22 '08 #1
1 3577
Dormilich
8,658 Expert Mod 8TB
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; */
Aug 24 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Ney André de Mello Zunino | last post by:
Hello. The issue is quite known: you have a block-level container holding a set of floated elements and you need that the container's content height take the floated elements' dimensions into...
6
by: Florian Brucker | last post by:
Here's the code: <html> <head> <title>CSS Test</title> <style> div.container { border-width:1px; border-color:#000; border-style:solid;
7
by: Don G | last post by:
Is it possible to lock the aspect ratio of container using CSS? For example, have a <div> that is resized according to the size of the browser window, but remains square, regardless of it's size....
19
by: derelicten | last post by:
hello , I have an issue positionating some pics I want to anchor to an existing table cell but I cant just place regular position on the cell because the background is fixed height and the set of...
3
by: ianv2 | last post by:
Hi I have a div which contains my local navigation bar, which has a blue background and is next to the content div, at the moment however this blue background colour stops after the unordered...
1
by: Miked | last post by:
Hello: I'm relatively new to CSS, and I'm doing a site where I don't want to use any tables. I've gotten pretty far, and the site has the layout I want. My only problem is that I'm using the...
2
by: ge5talt | last post by:
Hi all, I am looking for a switch that will style the height of a parent element to a specific % if the height of the contents is less than the height of the container (it doesnt spill out), or...
5
by: empiresolutions | last post by:
I'm trying to build a box that i can place content in. This box should dynamically change width and height to accommodate the content inside. I have build out a non-working example here...
12
nathj
by: nathj | last post by:
Hi, I have been working on a redesign of a site. this is a site that was developed by someone else and the CSS has been built to fit with the CMS that they supplied. This redesign is nearly...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.