Column heights

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • funkage
    New Member
    • Jul 2007
    • 7

    Column heights

    Hello.

    Is there actually a way to make a div layer fill up the entire browser? Apparently, '100%' set to the height attribute doesn't quite work.

    Thanks in advance.
  • drhowarddrfine
    Recognized Expert Expert
    • Sep 2006
    • 7434

    #2
    Yes it does:
    [HTML]<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <title></title>
    <meta http-equiv="content-type"
    content="text/html;charset=ut f-8">

    <style type="text/css">
    html,body{
    height:100%;
    margin:0
    }
    div{
    height:100%;
    background-color:#999
    }
    </style>

    </head>
    <body>

    <div></div>

    </body>
    </html>[/HTML]
    You must remember that when you set an element to 100%, you have to think, 100% of what? Since, in this case, the parent of the div is the body, and html is the parent of html, you must set them to 100%, too.

    Comment

    • funkage
      New Member
      • Jul 2007
      • 7

      #3
      Ah. So, I see. Thanks a lot for the enlightenment!

      Comment

      Working...