Forum Moderators: not2easy

Message Too Old, No Replies

Can Containers Be Auto Expandable?

         

MountainMan

11:31 pm on Dec 16, 2004 (gmt 0)

10+ Year Member



Hello,

I am trying to figure out a way to make a container automatically expand with my text. Here is my situation.

I have a container that spans the width of my page (we'll call it Main). Inside the container I have a left hand navbar and a text area (both are separate containers). So that is a total of three containers, two of which are inside the main one. My goal is to get the navbar container's height to be 100% of the page. I set the navbar container to height=100% and it fills spans the entire height of the Main container.

However, as the text container goes below the original height of the Main container the Main container holds it's original height and doesn't extend with it. I've been messing around with different combinations of relative and absolute positions and so far no luck.

Any advice would be greatly appreciated.

Thanks,

Matt

BonRouge

2:16 am on Dec 17, 2004 (gmt 0)

10+ Year Member



Is your text div floated?
If so, you probably just need a clearer div below those two divs. Something like this:
<div class="clearer"></div>

css:
.clearer {height:1px; clear:both; margin-top:-1px;}

If it's absolutely positioned, you have a different problem...

MountainMan

2:40 am on Dec 17, 2004 (gmt 0)

10+ Year Member



I don't have it floated. I found that in IE I can get it to work but Mozilla has a problem with it. I'm playing around with the absolute and relative positionings of the containers. I might think about floating it.

Thanks,

Matt

createErrorMsg

2:45 am on Dec 17, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I don't have it floated. I found that in IE I can get it to work but Mozilla has a problem with it. I'm playing around with the absolute and relative positionings of the containers. I might think about floating it.

We're going to be hard pressed to give you any insight without seeing the code you're working with thus far. If it's not floated, exactly how is it positioned? Snip out and post the relevant html and CSS code for us to see.

Off hand, it sounds like you need the Faux COlumns technique. It was discussed in a recent thread [webmasterworld.com]. There's also a link to the original article.

cEM

MountainMan

8:31 pm on Dec 17, 2004 (gmt 0)

10+ Year Member



Well actually I figured it out last night. What I had to do was not specify a specific height for the containers. This ended up giving me the auto-extend effect that I wanted.

Next time I will be more specific and send along the code with my post. That would help.

Thanks,

Matt