Browse Source

Use updated method for sticky footer

https://stackoverflow.com/questions/17966140/twitter-bootstrap-3-sticky-footer
http://getbootstrap.com/examples/sticky-footer/
Talha Mansoor 10 years ago
parent
commit
fa19ee0332
3 changed files with 24 additions and 29 deletions
  1. 22 24
      static/css/elegant.css
  2. 2 2
      templates/_includes/footer.html
  3. 0 3
      templates/base.html

+ 22 - 24
static/css/elegant.css

@@ -1,16 +1,4 @@
 /* Base */
-/* #push.height = -#content-sans-footer.margin-bottom = #footer.margin-top + ul.footer-content */
-body,
-html {
-    height: 100%;
-}
-#content-sans-footer {
-    min-height: 100%;
-    margin-bottom: -60px;
-}
-#push {
-    height: 60px;
-}
 h1,
 h2,
 h3,
@@ -44,29 +32,39 @@ hr {
 .top-menu li a {
     font-weight: bold;
 }
-/* Footer */
+/* Sticky footer styles
+-------------------------------------------------- */
+/* from http://getbootstrap.com/examples/sticky-footer/ */
+html {
+    position: relative;
+    min-height: 100%;
+}
+body {
+    /* Margin bottom by footer height */
+    margin-bottom: 60px;
+}
+.footer {
+  /* background-color: #f5f5f5; */
+    bottom: 0;
+    /* Set the fixed height of the footer here */
+    height: 60px;
+    position: absolute;
+    width: 100%;
+}
 #footer {
     border-top: 1px solid  rgba(0, 0, 0, .2);
     font: .8em Calibri, Tahoma, Arial, Sans-Serif;
-    margin: 15px 0 0 0;
-    padding: 0;
 }
 ul.footer-content {
-    list-style: none;
-    margin: -1px 0 0 0;
-    padding: 2px 5px 0;
     display: table;
-    height: 45px;
+    list-style: none;
+    margin: 20px 0;
     width: 100%;
-    -moz-box-sizing: border-box;
-    -webkit-box-sizing: border-box;
-    box-sizing: border-box;
 }
 ul.footer-content li {
-    padding-left: 5px;
     display: table-cell;
-    vertical-align: middle;
     height: 100%;
+    vertical-align: middle;
 }
 .elegant-power {
     text-align: right;

+ 2 - 2
templates/_includes/footer.html

@@ -1,5 +1,5 @@
-<footer>
-<div id="footer">
+<footer class="footer">
+<div id="footer" class="container">
     <ul class="footer-content">
         {% from '_includes/_defaults.html' import SITESUBTITLE with context %}
         {% if SITESUBTITLE %}

+ 0 - 3
templates/base.html

@@ -52,7 +52,6 @@
 {% include '_includes/analytics.html' %}
 </head>
 <body>
-<div id="content-sans-footer">
 
     <nav class="navbar navbar-default" role="navigation">
         <div class="container">
@@ -99,8 +98,6 @@
             </div>
         </div>
     </div>
-    <div id="push"></div>
-</div>
 {% include '_includes/footer.html' %}
 {% block script %}
 <script src="http://code.jquery.com/jquery.min.js"></script>