...

View Full Version : Problem with 100% div height



Voimis
09-15-2007, 03:52 PM
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

rams1703
09-15-2007, 05:32 PM
<!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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum