SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Enthusiast
    Join Date
    Dec 2005
    Posts
    75
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Creating a minimum div height

    Hi. I have a background image on my page and a container with a different background color. I want the container and the contained divs to be able to extend when needed, but I am hoping there is a way to set a minimum height and let it extend from there. Two of my pages will better demonstrate why this is needed.
    http://www.mzbc.com/missions.shtml and
    http://www.mzbc.com/music.shtml

    The first is good as it ends at the bottom of the screen with nothing showing below. The second shows the background beneath the container though, which is not very attractive. This is being view on a 1024x768. I can set a height that is longer than will be needed, but I will have to be constantly making it larger when I add text that exceeds the div height. Hope this makes sense. THanks.

    Jedidiah

  2. #2
    Once I was a Factory Worker goofy's Avatar
    Join Date
    Dec 2004
    Location
    Sydney Australia
    Posts
    559
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can use the min-height property. It is supported by browsers supporting CSS2 like Netscape 6, Mozilla browsers, Opera 7 or later only. However it doesn't work on IE.
    Goofy
    Life is what you make it!
    Follow your dreams!

  3. #3
    SitePoint Enthusiast
    Join Date
    Dec 2005
    Posts
    75
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's not good news. I may have to resort to just specifying a really long height which will be really annoying for low-content pages.

  4. #4
    Non-Member Egor's Avatar
    Join Date
    Jan 2004
    Location
    Melbourne, Australia
    Posts
    7,305
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    IE actually treats height as min-height, and that bug can be taken advantage of - http://www.cssplay.co.uk/boxes/minheight.html

  5. #5
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,281
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    Or look at the faq here on min-height :

    http://www.sitepoint.com/forums/show...8&postcount=31

  6. #6
    SitePoint Enthusiast
    Join Date
    Dec 2005
    Posts
    75
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks, that worked perfectly!


Bookmarks

Posting Permissions

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