Skip to content

Instantly share code, notes, and snippets.

@felipecabargas
Created July 3, 2014 18:51
Show Gist options
  • Save felipecabargas/583fd10e4653cd891fd0 to your computer and use it in GitHub Desktop.
Save felipecabargas/583fd10e4653cd891fd0 to your computer and use it in GitHub Desktop.
Sticky Footer
<!DOCTYPE html>
<html>
<head>
<title>Rails Application</title>
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
<%= csrf_meta_tags %>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<div class="wrapper">
<%= render 'layouts/header' %>
<div class="container">
<%= yield %>
</div>
<div class="push"></div>
</div>
<%= render 'layouts/footer' %>
</body>
</html>
* {
margin: 0;
}
html, body {
height: 100%;
}
.wrapper {
min-height: 100%;
height: auto !important;
height: 100%;
margin: 0 auto -100px;
}
footer{
background: $default;
border-top: 5px solid #52BCE2;
color: white;
padding: 40px;
a{
margin-left: 15px;
color: white;
}
font-size: 12px;
}
footer, .push {
height: 100px; /* .push must be the same height as .footer */
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment