Skip to content

Instantly share code, notes, and snippets.

@florentsorel
Created January 27, 2014 13:29
Show Gist options
  • Save florentsorel/8648570 to your computer and use it in GitHub Desktop.
Save florentsorel/8648570 to your computer and use it in GitHub Desktop.
Sticky footer & height 100%
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8" />
<title>Homepage</title>
<link rel="icon" type="image/png" href="favicon.png">
<meta name="viewport" content="width=1000, initial-scale=1">
</head>
<body>
<div id="page"><!-- #page -->
<div id="global"><!-- #global -->
<div class="wrap">
<div id="header">
<a href="#" class="logo">
<img src="img/logo.png" alt="Logo">
</a>
</div>
<div id="container">
<p>test</p>
</div>
</div>
</div><!-- /#global -->
<div id="footer">
<div class="wrap">
footer
</div>
</div>
</div><!-- /#page -->
</body>
</html>
html, body {
height: 100%;
}
#page {
position: relative;
min-height: 100%;
}
#global {
padding-bottom: 115px;
}
#container {
margin-bottom: 20px;
}
#footer {
position: absolute;
bottom: 0;
width: 100%;
height: 115px;
color: #FFF;
.wrap {
height: 115px;
background: #c92127;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment