homepage Welcome to WebmasterWorld Guest from 54.161.246.212
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderators: not2easy

CSS Forum

    
Nested DIVs height: problem
Trying to get child DIV to automatically adjust to parent's height.
lZakl

5+ Year Member



 
Msg#: 8520 posted 8:43 pm on Feb 20, 2006 (gmt 0)

I am having difficulty trying to get child DIV to automatically adjust to parent's height. Here's my CSS:

#menubar {padding-top: 15px; margin-right: 77px; float: left; width: 163px; height: 100%; border: 0; background-color: #2B04BD;}
#content {float: left; width: 95%; background-color: #ffffff;}

Now my #content DIV is filled with dynamic content, so the height of the div will change day-to day. The code on the page reads simply:

<div id="content">
<!--####### Sidebar-->
<div id="menubar">
Side Menu ---
</div>
<!--####### End Sidebar-->
LOTS OF CONTENT WIL GO HERE
</div>

Now since the #menubar DIV has a colored bg, I would like it to continue all the way down to the bottom of the #content DIV. Is setting the height to 100% not enough? I thought this was acceptable, but obviously I am doing something wrong! I have tried searching Google for "Nested DIVs" and other like searches, but have been unsuccessful in finding my problem in particular. Any help on this matter is GREATLY appreciated!

Thanks!

-- Zak

 

Kufu

5+ Year Member



 
Msg#: 8520 posted 10:09 pm on Feb 20, 2006 (gmt 0)

Now, wouldn't that be nice. I think this is a bug, and simply does not work (100% height that is).

Maybe someone knows a trick, because I can use an answer too. :)

coopersita

5+ Year Member



 
Msg#: 8520 posted 4:41 pm on Feb 21, 2006 (gmt 0)

Why don't you put a background in the parent container that has both the content and sidebar backgrounds in it.

Google for faux columns.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / CSS
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved