mirror of
https://github.com/twbs/bootstrap.git
synced 2024-12-10 22:24:19 +01:00
82 lines
1.8 KiB
HTML
82 lines
1.8 KiB
HTML
---
|
|
layout: example
|
|
title: Sticky footer template
|
|
---
|
|
|
|
<!-- Custom styles for this template -->
|
|
<style>
|
|
|
|
/* Sticky footer styles
|
|
-------------------------------------------------- */
|
|
|
|
html,
|
|
body {
|
|
height: 100%;
|
|
/* The html and body elements cannot have any padding or margin. */
|
|
}
|
|
|
|
/* Wrapper for page content to push down footer */
|
|
#wrap {
|
|
min-height: 100%;
|
|
height: auto !important;
|
|
height: 100%;
|
|
/* Negative indent footer by its height */
|
|
margin: 0 auto -60px;
|
|
}
|
|
|
|
/* Set the fixed height of the footer here */
|
|
#push,
|
|
#footer {
|
|
height: 60px;
|
|
}
|
|
#footer {
|
|
background-color: #f5f5f5;
|
|
}
|
|
|
|
/* Lastly, apply responsive CSS fixes as necessary */
|
|
@media (max-width: 767px) {
|
|
#footer {
|
|
margin-left: -20px;
|
|
margin-right: -20px;
|
|
padding-left: 20px;
|
|
padding-right: 20px;
|
|
}
|
|
}
|
|
|
|
/* Custom page CSS
|
|
-------------------------------------------------- */
|
|
/* Not required for template or sticky footer method. */
|
|
|
|
.container {
|
|
width: auto;
|
|
max-width: 680px;
|
|
}
|
|
.container .credit {
|
|
margin: 20px 0;
|
|
}
|
|
|
|
</style>
|
|
|
|
|
|
|
|
<!-- Wrap all page content here -->
|
|
<div id="wrap">
|
|
|
|
<!-- Begin page content -->
|
|
<div class="container">
|
|
<div class="page-header">
|
|
<h1>Sticky footer</h1>
|
|
</div>
|
|
<p class="lead">Pin a fixed-height footer to the bottom of the viewport in desktop browsers with this custom HTML and CSS.</p>
|
|
<p>Use <a href="./sticky-footer-navbar.html">the sticky footer with a fixed navbar</a> if need be, too.</p>
|
|
</div>
|
|
|
|
<div id="push"></div>
|
|
</div>
|
|
|
|
<div id="footer">
|
|
<div class="container">
|
|
<p class="muted credit">Example courtesy <a href="http://martinbean.co.uk">Martin Bean</a> and <a href="http://ryanfait.com/sticky-footer/">Ryan Fait</a>.</p>
|
|
</div>
|
|
</div>
|