Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Nov 2008
    Posts
    19
    Thanks
    1
    Thanked 0 Times in 0 Posts

    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 11:11 PM.

  • #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,688
    Thanks
    22
    Thanked 1,829 Times in 1,813 Posts
    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

  • #3
    New to the CF scene
    Join Date
    Nov 2011
    Location
    Denmark
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •