Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-07-2011, 10:07 PM   PM User | #1
ramenraider
New Coder

 
Join Date: Nov 2008
Posts: 19
Thanks: 1
Thanked 0 Times in 0 Posts
ramenraider is an unknown quantity at this point
Height of container on page w/ dynamic content

I have my "container" which is basically the holder of all the page content. The container stops as soon as it hits php based section, even when i have overflow: visible;

#main_body
{
border-left:solid 10px #FFFFFF;
border-right:solid 10px #FFFFFF;
border-bottom:solid 10px #FFFFFF;
background:#FFFFFF;
margin:auto;
width:930px;
padding-bottom:40px;
overflow:visible;
}

The page has different things that show up depending on a variety of things. Is there any way to have the height change along with the changing page content?

There are floats on the page, but I have a <div style="clear:both;"></div> at the bottom

(i'd post code but it's pretty messy and long, I don't think anyone wants to go through it)

Last edited by ramenraider; 11-07-2011 at 10:11 PM..
ramenraider is offline   Reply With Quote
Old 11-07-2011, 11:34 PM   PM User | #2
Excavator
Master Coder


 
Excavator's Avatar
 
Join Date: Dec 2006
Location: Alaska
Posts: 9,410
Thanks: 22
Thanked 1,765 Times in 1,749 Posts
Excavator has a spectacular aura aboutExcavator has a spectacular aura aboutExcavator has a spectacular aura about
Hello ramenraider,
Typically it's overflow: auto; that does the trick. It's hard to know why your #main_body does not enclose it's contents without seeing the code. Could be anything from a lack of DocType to invalid code... See the links in my signature line for help with both of those issues.
__________________
Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad
Excavator is offline   Reply With Quote
Old 11-08-2011, 03:55 PM   PM User | #3
Hoatzin
New to the CF scene

 
Join Date: Nov 2011
Location: Denmark
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Hoatzin is an unknown quantity at this point
usually it's a no go to have a width without a defined height.

#main_body
{
border-left:solid 10px #FFFFFF;
border-right:solid 10px #FFFFFF;
border-bottom:solid 10px #FFFFFF;
background:#FFFFFF;
margin:auto;
width:930px;
min-height:600px;
height:auto;
padding-bottom:40px;
overflow:visible;
}

here i have set a minumum height at 600 pixels so the "container" will always be at least 600 pixels height and will change if more content is added.
Hoatzin is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 05:59 AM.


Advertisement
Log in to turn off these ads.