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 to the CF scene
    Join Date
    May 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Making Website Subsections Expand to Fill Screen

    This is the first website I've ever made, so please excuse my ignorance. I'm trying to make a personal website but it's in its very early stages (the code doesn't validate, visual errors, etc.). I'm trying to make my subsections expand to fill the screen vertically even if there's no content there, but I can't figure out how.

    A version of the site is posted here:
    http://personal.psu.edu/zcb5012/testsite22.html
    If you open it, you'll see what I mean about expanding the subsections.

    I tried using min-height:100% on all the subsection wrappers (btw, I'm not worried about IE6), and that worked alright until I applied an XHTML doctype to the page. Does min-height just not work with XHTML? Should I use a different doctype? I couldn't find out online :/

    Any help would be appreciated. Thanks a lot!

  • #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,678
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Hello valhalla8,
    I have a very simple example of a full height layout here. It works in all browsers too, even the IE6 you're not worried about.

    That will not work for your sub-sections though, it only works once and you have multiple subs. height: 100%; won't work either, as you've seen.
    I think you may need to find a js solution for this.
    I'm no js guy but I found this...
    Code:
    function resize(){  var frame = document.getElementById("frame1");  var htmlheight = document.body.parentNode.scrollheight;  var windowheight = window.innerheight;  if ( htmlheight < windowheight ) { document.body.style.height = windowheight + "px"; frame.style.height = windowheight + "px"; }  else { document.body.style.height = htmlheight + "px"; frame.style.height = htmlheight + "px"; }  }
    Google javascript full height and see what else you can come up with.
    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
    Senior Coder effpeetee's Avatar
    Join Date
    Feb 2007
    Location
    Clapham Junction - London SW
    Posts
    4,885
    Thanks
    228
    Thanked 204 Times in 203 Posts
    You can find some useful sites here.

    Frank
    * Sources (updated: 21.11.2012.
    Using Windows 8 Professional. 64bit with HP Photosmart 5510 printer Very useful site here.


  •  

    Posting Permissions

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