473,473 Members | 1,577 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

CSS height expanding inner DIV

What I would like is to create an inner div (inner1) which will expand
vertically (or the height) to its outer div container (outer). The
outer div does not have a set height but will expand when another div
(inner2) inside outer expands vertically with content. I cannot seem to
get a div to expand vertically when the outer div is NOT set to expand
100%. Anyone know how to do this. I've placed the code below.
<style type="text/css">
/* commented backslash mac hiding hack \*/
..outer {
border: 1px solid #006600;
}
..inner1{
border: 1px solid #CC0000;
padding: 6px;
float: left;
}

</style>
<div class="outer">
<div class="inner1">asdf</div>
<div class="inner2">
asdfasfd<BR />
asdfasdf<BR />
asdf
</div>
</div>

Sep 6 '06 #1
3 5300
Els
ry******@yahoo.com wrote:
What I would like is to create an inner div (inner1) which will expand
vertically (or the height) to its outer div container (outer). The
outer div does not have a set height but will expand when another div
(inner2) inside outer expands vertically with content. I cannot seem to
get a div to expand vertically when the outer div is NOT set to expand
100%. Anyone know how to do this.
Not possible afaik.
I've placed the code below.
[snip]

Looks like you just want equal height columns, like many other people
do too. If your div.inner2 is always taller than div.inner1, it's easy
to fake. Give div.inner2 a left margin, the same width as div.inner1.
Then give div.inner1 the same background colour as div.outer, and
div.inner2 a different one.

--
Els http://locusmeus.com/
accessible web design: http://locusoptimus.com/
Sep 6 '06 #2
No that will not work for this situation. I will be adding a background
image to inner1. Inner1 needs to stretch to the height of inner2 (the
height of inner1 & inner2's container - outer). Faking it won't work
because the background image will not be shown. I cannot place the
background image in outer either for reasons to complicated to discuss.
Els wrote:
ry******@yahoo.com wrote:
What I would like is to create an inner div (inner1) which will expand
vertically (or the height) to its outer div container (outer). The
outer div does not have a set height but will expand when another div
(inner2) inside outer expands vertically with content. I cannot seem to
get a div to expand vertically when the outer div is NOT set to expand
100%. Anyone know how to do this.

Not possible afaik.
I've placed the code below.

[snip]

Looks like you just want equal height columns, like many other people
do too. If your div.inner2 is always taller than div.inner1, it's easy
to fake. Give div.inner2 a left margin, the same width as div.inner1.
Then give div.inner1 the same background colour as div.outer, and
div.inner2 a different one.

--
Els http://locusmeus.com/
accessible web design: http://locusoptimus.com/
Sep 7 '06 #3
Els
ry******@yahoo.com wrote:

[equal height columns]
No that will not work for this situation. I will be adding a background
image to inner1. Inner1 needs to stretch to the height of inner2 (the
height of inner1 & inner2's container - outer). Faking it won't work
because the background image will not be shown. I cannot place the
background image in outer either for reasons to complicated to discuss.
I was indeed gonna say "place it in div.outer", but if the reasons not
to are too complicated to discuss, there's not much I can discuss then
:-)

Except perhaps on the topic of top-posting. Would you please reply
below the pieces of text you are replying to, and snip what isn't
relevant anymore?

Thanks :-)
--
Els http://locusmeus.com/
accessible web design: http://locusoptimus.com/
Sep 7 '06 #4

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

Similar topics

1
by: IC | last post by:
Hi - I have a question about the following code: <script> document.write('<span id="outter" style="position:relative;">'); document.write("<object...
5
by: Secret Guy | last post by:
Because of my experience posting various places over the last couple of weeks: I'm expecting to be greated with hostility for asking about concepts instead of "practical" things, since that has...
12
by: Kepler | last post by:
How do you get the height of the client browser in IE? Both document.body.clientHeight and document.body.offsetHeight return the height of the document. If the page is long and there's a vertical...
2
by: Animanera | last post by:
Hi to all. Is there a way that I can obtain the WINDOW INNER HEIGHT via JS (need only for Internet Explorer 6)? But please give attention to the words INNER and WINDOW. In particular, INNER...
0
by: rocketmonkeys | last post by:
The below mangled garbage is a fixed text illustration. I'll try to describe the problem. This is a general web layout problem I've had for a while, not confined to this specific case. I would...
4
by: Berko | last post by:
I have a javascript that manipulates the DOM with content that will be of variable heights. How can I ascertain how high my div needs to be in order to show all content without scroll bars. Rather...
10
by: dtmfcc | last post by:
My website is at www.simi-therapy.com My CSS is at http://www.simi-therapy.com/simitherapy-screen.css Question -- on the dark blue bar under the beach image, one change caused another...
1
by: lilOlMe | last post by:
I'm really starting to lose it on this problem. I have created 2 <div> tags that will server as boxes. While explaining my problem I will refer to these <div> tags as Boxes...to keep things...
4
by: ge5talt | last post by:
Longtime reader, 1st time poster :) I am in the process of overhauling a website and replacing an old table-based quirksmode layout with a standards-mode tableless one. I am currently working on...
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...
1
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.