473,386 Members | 1,819 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,386 software developers and data experts.

Make div inherit another div's height

Hi, i have this code on a test site:
<html>
<head>
<style type="text/css">
#main{
border:1px solid #000063;
border-width:1px;
background:#FFF;
width:400px;
margin: 0 auto;
height:auto;
overflow:auto;
}
#left{
background:#AAAAAA;
width:70%;
float:left;
}
#right{
background:#444444;
width:30%;
float:right;
color:#FFF;
}
</style>
</head>
<body>

<div id="main">
<div id="left">
#left div
<p>Loren Ipsum blah blah or something</p>
<p>Loren Ipsum blah blah or something</p>
<p>Loren Ipsum blah blah or something</p>
<p>Loren Ipsum blah blah or something</p>
<p>Loren Ipsum blah blah or something</p>
<p>Loren Ipsum blah blah or something</p>
<p>Loren Ipsum blah blah or something</p>
<p>Loren Ipsum blah blah or something</p>
</div>
<div id="right">
#right div<br>
I want this to grow to match #left's height
</div>
</div>
</body>
</html>

On Firefox, i had to set overflow:auto on the main div so it would
expand its height to
accomodate the other 2 divs. IE6 did this by default.

The problem is that i have a main div, with 2 divs inside it, one
floated to the left at 75% width, and one floated to the right at 25%
width.

When the content differs in both divs (meaning, div #left height's is
different than div #right height's), the height of the small one
doesn't expand to match the bigger's one height.

How can i do this? I think the code is self-explaining, if not then i
would gladly upload it somewhere.

Sep 6 '06 #1
0 7590

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: ajay | last post by:
I have following code for a slide menu but i twiked it to work for a single level menu. Open it in a Browser to get a clear picture. I have 2 Qs 1) How to make first entry as non-link. i.e i...
4
by: Shash | last post by:
Hey People, I'm facing a issue with browser compatablity here, I want a certain group of divs to behave like a table row, i.e if one of the cell/div has content longer than the other divs, all...
10
by: Luke | last post by:
Hi. I am trying to make correct layout, here is an example of (dynamically generated content via jsp): http://localhost/www/layout.htm Most outer div is positioned absolute (if not then it...
6
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of...
7
by: Ryaby21 | last post by:
Please help! i have everything set up with my CSS HTML layout and its all good. im using 3 divs at the moment and what i want to to do now is to add a new div with a background for the page. My...
3
by: Max58kl | last post by:
Hi I am currently trying to create a FAQ webpage. At the moment the code I have lets me click on the Questions which successfully shows and hides the <DIV> tags containing the Answers. But...
11
by: sariset | last post by:
here is a sample of my problem <table style="width:100%;height:100%"> <tr style="height: 60%"> <td style="width: 968px"> <div style="height:...
9
by: Lloyd Sheen | last post by:
I have now spent the entire morning on what I think should be easy. I cannot for the life of me figure out how to make a simple one row, two column table where is the contents of the one of the...
9
by: GloStix | last post by:
Okay, when I click the link it dissapears and makes a white space underneath it but the space is clickable. so when you click the space, the link actually works Used Firefox 3.0 RC2 for this. OS X...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.