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 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Sep 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Problem with 100% div height

    Hi

    Im trying to make layout with container div which height is 90% and width is 100% with 10% top-margin. So layout high would be 100% scaling with resolution of user, but there are problem... It leaves margin also to bottom!

    Im using this but it leaves margin also to bottom. What can I do?

    body, html {
    background-color : #000000;
    margin : 0px;
    padding : 0px;
    border : 0px;
    width : 100%;
    height : 100%;
    }

    #container {
    width : 100%;
    min-width : 100%;
    height : 90%;
    min-height : 90%;
    margin-top : 10%;
    background-color : #FFFFFF;
    }

    Thanks a lot!

    Voimis

  • #2
    New Coder
    Join Date
    Sep 2007
    Posts
    34
    Thanks
    0
    Thanked 7 Times in 7 Posts
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <style type="text/css">
    body, html {
    background-color:#000000;
    margin:0 auto;
    padding : 0px;
    border : 0px;
    width : 100%;
    height : 100%;
    }
    #container {
    width : 100%;
    min-width : 100%;
    height:100%;
    min-height:100%;
    margin-top:10%;
    background-color:#FFFFFF;
    }
    </style>
    </head>
    <body>
    <div id="container"></div>
    </body>
    </html>

    OR try this


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <style type="text/css">
    body, html {
    background-color:#FFFFFF;
    margin:0 auto;
    padding : 0px;
    border : 0px;
    width : 100%;
    height : 100%;
    }
    #container {
    height:10%;
    background-color:#000000;
    }
    </style>
    </head>
    <body>
    <div id="container"></div>
    </body>
    </html>


    gud day,
    rams
    Last edited by rams1703; 09-16-2007 at 04:25 PM.


  •  

    Posting Permissions

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