Old 03-03-2009, 03:03 AM   #1 (permalink)
Phantom's Freak
 
Glavus's Avatar
 
Join Date: May 2006
Location: No Idea.
Posts: 2,564
Reputation: 38
Send a message via AIM to Glavus Send a message via MSN to Glavus
Default Nested div tags (NEED HELP)

I haven't done web design in a long time and I just started working on this website... well anyways this is my problem.

I have a div tag for the content of the site then three sections like so;

<div id="main">
<div id="menu">
</div>

<div id="content">
</div>

<div id="sidebar">
</div>
</div>
Code:
#main {
	width: 922px;
	background: #8dac83;
	margin: 0 auto;
	}
/* Menu */

#menu {
	float: left;
	width: 202px;
	
}


/* Sidebar */

#sidebar {
 float: left;
 width: 160px;
}


/* Content */

#content {
	float: left;
	width: 558px;
	background: #FFFFFF;
So its just three sections in one main div tag, my question is how can I make the main div stretch automatically to fit the size of my biggest column whichever it happens to be? I know IE automatically resizes my "main" div to whatever the biggest one inside is, but on Firefox I don't seem to be able to accomplish it ! Am I going to have to assign it a certain amount of pixels for height or can I stretch it without having anything else besides the nested divs??
__________________
Glavus is offline  
Old 03-04-2009, 03:33 AM   #2 (permalink)
Pikachu's Flea Collar
 
NoodlePowa's Avatar
 
Join Date: Oct 2008
Location: California
Posts: 50
Reputation: 10
Default

By "stretch" I'm inferring you want to make the height fill the parent element. Or order to do so, most people would have tried:

height: 100%;

But that alone is not enough because if it has 100% height, what is it 100% of? In order to accomplish this task, you'll need to have a parent element with a set height. Essentially, you'll also need another "height: 100%;" (for example, your body) for your parent element. However, I was not able to see that you had provided a parent element for your "main" div.

If, however, I did not understand your question correctly, I apologize.
__________________
Scientia sapientiaque et veritas te liberabunt.
NoodlePowa is offline  
Old 03-12-2009, 07:21 PM   #3 (permalink)
Phantom's Freak
 
Glavus's Avatar
 
Join Date: May 2006
Location: No Idea.
Posts: 2,564
Reputation: 38
Send a message via AIM to Glavus Send a message via MSN to Glavus
Default

Yeah I tried that, worked with IE not firefox. I ended up using overflow: auto;
to stretch container of nested divs.
__________________
Glavus is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 04:22 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.6.0
OnRPG, Copyright ©2003-2011, Game Entertainment Enterprises