Tuesday, May 22, 2012

Code for Footer should be at bottom in all the cases


<!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=iso-8859-1" />
<title>Untitled Document</title>
<style>
html, body{ height:100%; }
#main-wrapper{ min-height:100%; position:relative; }
#footer{ height:100px; background:#999999; position:absolute; bottom:0px; width:100%; }
</style>
</head>

<body style="padding:0px; margin:0px;">

<div id="main-wrapper">
<div style="height:100px;">h</div>
<div style="padding-bottom:100px;">Content</div>
<div id="footer"></div>
</div>
</body>
</html>

No comments:

Post a Comment