<p>I have a simple 2-column layout with a footer that clears both the right and left div in my markup.  My problem is that I can't get the footer to stay at the bottom of the page in all browsers.  It works if the content pushes the footer down, but that's not always the case. </p>

[{'answer_id': 42301, 'author': 'Staale', 'author_id': 3355, 'author_profile': 'https://Stackoverflow.com/users/3355', 'pm_score': 9, 'selected': True, 'text': '<p>To get a sticky footer:</p>\n\n<ol>\n<li><p>Have a <code>&lt;div&gt;</code> with <code>class="wrapper"</code> for your content.</p></li>\n<li><p>Right <strong>before</strong> the closing <code>&lt;/div&gt;</code> of the <code>wrapper</code> place the\n<code>&lt;div class="push"&gt;&lt;/div&gt;</code>.</p></li>\n<li><p>Right <strong>after</strong> the closing <code>&lt;/div&gt;</code> of the <code>wrapper</code> place the \n<code>&lt;div class="footer"&gt;&lt;/div&gt;</code>.</p></li>\n</ol>\n\n<pre class="lang-css prettyprint-override"><code>* {\n    margin: 0;\n}\nhtml, body {\n    height: 100%;\n}\n.wrapper {\n    min-height: 100%;\n    height: auto !important;\n    height: 100%;\n    margin: 0 auto -142px; /* the bottom margin is the negative value of the footer\'s height */\n}\n.footer, .push {\n    height: 142px; /* .push must be the same height as .footer */\n}\n</code></pre>\n'}, {'answer_id': 42302, 'author': 'John Sheehan', 'author_id': 1786, 'author_profile': 'https://Stackoverflow.com/users/1786', 'pm_score': -1, 'selected': False, 'text': "<p>Try putting a container div (with overflow:auto) around the content and sidebar.</p>\n\n<p>If that doesn't work, do you have any screenshots or example links where the footer isn't displayed properly?</p>\n"}, {'answer_id': 42303, 'author': 'Grey Panther', 'author_id': 1265, 'author_profile': 'https://Stackoverflow.com/users/1265', 'pm_score': 0, 'selected': False, 'text': '<p>One solution would be to set the min-height for the boxes. Unfortunately it seems that <a href="http://www.wellstyled.com/css-minheight-hack.html" rel="nofollow noreferrer">it\'s not well supported by IE</a> (surprise).</p>\n'}, {'answer_id': 42314, 'author': 'Raleigh Buckner', 'author_id': 1153, 'author_profile': 'https://Stackoverflow.com/users/1153', 'pm_score': 4, 'selected': False, 'text': '<p>Set the CSS for the <code>#footer</code> to:</p>\n\n<pre class="lang-css prettyprint-override"><code>position: absolute;\nbottom: 0;\n</code></pre>\n\n<p>You will then need to add a <code>padding</code> or <code>margin</code> to the bottom of your <code>#sidebar</code> and <code>#content</code> to match the height of <code>#footer</code> or when they overlap, the <code>#footer</code> will cover them.</p>\n\n<p>Also, if I remember correctly, IE6 has a problem with the <code>bottom: 0</code> CSS. You might have to use a JS solution for IE6 (if you care about IE6 that is).</p>\n'}, {'answer_id': 42315, 'author': 'Jimmy', 'author_id': 4435, 'author_profile': 'https://Stackoverflow.com/users/4435', 'pm_score': 5, 'selected': False, 'text': '<p>You could use <code>position: absolute</code> following to put the footer at the bottom of the page, but then make sure your 2 columns have the appropriate <code>margin-bottom</code> so that they never get occluded by the footer.</p>\n\n<pre class="lang-css prettyprint-override"><code>#footer {\n    position: absolute;\n    bottom: 0px;\n    width: 100%;\n}\n#content, #sidebar { \n    margin-bottom: 5em; \n}\n</code></pre>\n'}, {'answer_id': 5138228, 'author': 'obecalp', 'author_id': 47303, 'author_profile': 'https://Stackoverflow.com/users/47303', 'pm_score': 0, 'selected': False, 'text': "<p>None of these pure css solutions work properly with dynamically resizing content (at least on firefox and Safari) e.g., if you have a background set on the container div, the page and then resize (adding a few rows) table inside the div, the table can stick out of the bottom of the styled area, i.e., you can have half the table in white on black theme and half the table complete white because both the font-color and background color is white. It's basically unfixable with themeroller pages.</p>\n\n<p>Nested div multi-column layout is an ugly hack and the 100% min-height body/container div for sticking footer is an uglier hack.</p>\n\n<p>The only none-script solution that works on all the browsers I've tried: a much simpler/shorter table with thead (for header)/tfoot (for footer)/tbody (td's for any number of columns) and 100% height. But this have perceived semantic and SEO disadvantages (tfoot must appear before tbody. ARIA roles may help decent search engines though).</p>\n"}, {'answer_id': 9345207, 'author': 'Sophivorus', 'author_id': 809356, 'author_profile': 'https://Stackoverflow.com/users/809356', 'pm_score': 4, 'selected': False, 'text': "<p>Here is a solution with jQuery that works like a charm. It checks if the height of the window is greater than the height of the body. If it is, then it changes the margin-top of the footer to compensate. Tested in Firefox, Chrome, Safari and Opera.</p>\n\n<pre><code>$( function () {\n\n    var height_diff = $( window ).height() - $( 'body' ).height();\n    if ( height_diff &gt; 0 ) {\n        $( '#footer' ).css( 'margin-top', height_diff );\n    }\n\n});\n</code></pre>\n\n<p>If your footer already has a margin-top (of 50 pixels, for example) you will need to change the last part for:</p>\n\n<pre><code>css( 'margin-top', height_diff + 50 )\n</code></pre>\n"}, {'answer_id': 12130241, 'author': 'Paul Sweatte', 'author_id': 1113772, 'author_profile': 'https://Stackoverflow.com/users/1113772', 'pm_score': 1, 'selected': False, 'text': '<p>Use absolute positioning and z-index to create a sticky footer div at any resolution using the following steps:</p>\n<ul>\n<li>Create a footer div with <code>position: absolute; bottom: 0;</code> and the desired height</li>\n<li>Set the padding of the footer to add whitespace between the content bottom and the window bottom</li>\n<li>Create a container <code>div</code> that wraps the body content with <code>position: relative; min-height: 100%;</code></li>\n<li>Add bottom padding to the main content <code>div</code> that is equal to the height plus padding of the footer</li>\n<li>Set the <code>z-index</code> of the footer greater than the container <code>div</code> if the footer is clipped</li>\n</ul>\n<p>Here is an example:</p>\n<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">\r\n<div class="snippet-code">\r\n<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!doctype html&gt;\n&lt;html&gt;\n  &lt;head&gt;\n    &lt;title&gt;Sticky Footer&lt;/title&gt;\n    &lt;meta charset="utf-8"&gt;\n    &lt;style&gt;\n      .wrapper { position: relative; min-height: 100%; }\n      .footer { position: absolute; bottom:0; width: 100%; height: 200px; padding-top: 100px; background-color: gray; }\n      .column { height: 2000px; padding-bottom: 300px; background-color: grxqeen; }\n      /* Set the `html`, `body`, and container `div` to `height: 100%` for IE6 */\n    &lt;/style&gt;\n  &lt;/head&gt;\n  &lt;body&gt;\n    &lt;div class="wrapper"&gt;\n      &lt;div class="column"&gt;\n        &lt;span&gt;hello&lt;/span&gt;\n      &lt;/div&gt;\n      &lt;div class="footer"&gt;\n        &lt;p&gt;This is a test. This is only a test...&lt;/p&gt;\n      &lt;/div&gt;\n    &lt;/div&gt;\n  &lt;/body&gt;\n&lt;/html&gt;</code></pre>\r\n</div>\r\n</div>\r\n</p>\n'}, {'answer_id': 26090114, 'author': 'Danield', 'author_id': 703717, 'author_profile': 'https://Stackoverflow.com/users/703717', 'pm_score': 7, 'selected': False, 'text': '<h2>Use CSS vh units!</h2>\n\n<p>Probably the most obvious and non-hacky way to go about a sticky footer would be to make use of the new <a href="http://www.w3.org/TR/css3-values/#viewport-relative-lengths">css viewport units</a>.</p>\n\n<p>Take for example the following simple markup:</p>\n\n<pre><code>&lt;header&gt;header goes here&lt;/header&gt;\n&lt;div class="content"&gt;This page has little content&lt;/div&gt;\n&lt;footer&gt;This is my footer&lt;/footer&gt;\n</code></pre>\n\n<p>If the header is say 80px high and the footer is 40px high, then we can make our sticky footer <em>with one single rule</em> on the content div:</p>\n\n<pre><code>.content {\n    min-height: calc(100vh - 120px);\n    /* 80px header + 40px footer = 120px  */\n}\n</code></pre>\n\n<p>Which means: let the height of the content div be <strong>at least</strong> 100% of the viewport height minus the combined heights of the header and footer.</p>\n\n<p>That\'s it.</p>\n\n<p><div class="snippet" data-lang="js" data-hide="true">\r\n<div class="snippet-code snippet-currently-hidden">\r\n<pre class="snippet-code-css lang-css prettyprint-override"><code>* {\r\n    margin:0;\r\n    padding:0;\r\n}\r\nheader {\r\n    background: yellow;\r\n    height: 80px;\r\n}\r\n.content {\r\n    min-height: calc(100vh - 120px);\r\n    /* 80px header + 40px footer = 120px  */\r\n    background: pink;\r\n}\r\nfooter {\r\n    height: 40px;\r\n    background: aqua;\r\n}</code></pre>\r\n<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;header&gt;header goes here&lt;/header&gt;\r\n&lt;div class="content"&gt;This page has little content&lt;/div&gt;\r\n&lt;footer&gt;This is my footer&lt;/footer&gt;</code></pre>\r\n</div>\r\n</div>\r\n</p>\n\n<p>... and here\'s how the same code works with lots of content in the content div:<div class="snippet" data-lang="js" data-hide="true">\r\n<div class="snippet-code snippet-currently-hidden">\r\n<pre class="snippet-code-css lang-css prettyprint-override"><code>* {\r\n    margin:0;\r\n    padding:0;\r\n}\r\nheader {\r\n    background: yellow;\r\n    height: 80px;\r\n}\r\n.content {\r\n    min-height: calc(100vh - 120px);\r\n    /* 80px header + 40px footer = 120px  */\r\n    background: pink;\r\n}\r\nfooter {\r\n    height: 40px;\r\n    background: aqua;\r\n}</code></pre>\r\n<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;header&gt;header goes here&lt;/header&gt;\r\n&lt;div class="content"&gt;Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Typi non habent claritatem insitam; est usus legentis in iis qui facit eorum claritatem. Investigationes demonstraverunt lectores legere me lius quod ii legunt saepius. Claritas est etiam processus dynamicus, qui sequitur mutationem consuetudium lectorum. Mirum est notare quam littera gothica, quam nunc putamus parum claram, anteposuerit litterarum formas humanitatis per seacula quarta decima et quinta decima. Eodem modo typi, qui nunc nobis videntur parum clari, fiant sollemnes in futurum.Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Typi non habent claritatem insitam; est usus legentis in iis qui facit eorum claritatem. Investigationes demonstraverunt lectores legere me lius quod ii legunt saepius. Claritas est etiam processus dynamicus, qui sequitur mutationem consuetudium lectorum. Mirum est notare quam littera gothica, quam nunc putamus parum claram, anteposuerit litterarum formas humanitatis per seacula quarta decima et quinta decima. Eodem modo typi, qui nunc nobis videntur parum clari, fiant sollemnes in futurum.\r\n&lt;/div&gt;\r\n&lt;footer&gt;\r\n    This is my footer\r\n&lt;/footer&gt;</code></pre>\r\n</div>\r\n</div>\r\n</p>\n\n<p><strong>NB:</strong></p>\n\n<p>1) The height of the header and footer must be known</p>\n\n<p>2) Old versions of IE (IE8-) and Android (4.4-) don\'t support viewport units. (<a href="http://caniuse.com/viewport-units/embed/">caniuse</a>)</p>\n\n<p>3) Once upon a time webkit had a problem with viewport units within a calc rule. This has indeed been fixed (<a href="http://blogs.adobe.com/webplatform/2014/06/12/improving-viewport-unit-support-in-webkit/">see here</a>) so there\'s no problem there. However if you\'re looking to avoid using calc for some reason you can get around that using negative margins and padding with box-sizing -</p>\n\n<p>Like so:<div class="snippet" data-lang="js" data-hide="true">\r\n<div class="snippet-code snippet-currently-hidden">\r\n<pre class="snippet-code-css lang-css prettyprint-override"><code>* {\r\n    margin:0;padding:0;\r\n}\r\nheader {\r\n    background: yellow;\r\n    height: 80px;\r\n    position:relative;\r\n}\r\n.content {\r\n    min-height: 100vh;\r\n    background: pink;\r\n    margin: -80px 0 -40px;\r\n    padding: 80px 0 40px;\r\n    box-sizing:border-box;\r\n}\r\nfooter {\r\n    height: 40px;\r\n    background: aqua;\r\n}</code></pre>\r\n<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;header&gt;header goes here&lt;/header&gt;\r\n&lt;div class="content"&gt;Lorem ipsum \r\n&lt;/div&gt;\r\n&lt;footer&gt;\r\n    This is my footer\r\n&lt;/footer&gt;</code></pre>\r\n</div>\r\n</div>\r\n</p>\n'}, {'answer_id': 27587208, 'author': 'Ajith', 'author_id': 4357818, 'author_profile': 'https://Stackoverflow.com/users/4357818', 'pm_score': 1, 'selected': False, 'text': '<p>CSS :</p>\n\n<pre><code>  #container{\n            width: 100%;\n            height: 100vh;\n            }\n #container.footer{\n            float:left;\n            width:100%;\n            height:20vh;\n            margin-top:80vh;\n            background-color:red;\n            }\n</code></pre>\n\n<p>HTML:</p>\n\n<pre><code>           &lt;div id="container"&gt;\n               &lt;div class="footer"&gt;\n               &lt;/div&gt;\n           &lt;/div&gt;\n</code></pre>\n\n<p>This should do the trick if you are looking for a responsive footer aligned at the bottom of the page,which always keeps a top-margin of 80% of the viewport height.</p>\n'}, {'answer_id': 31528677, 'author': 'Kyle Zimmer', 'author_id': 4293638, 'author_profile': 'https://Stackoverflow.com/users/4293638', 'pm_score': 0, 'selected': False, 'text': '<p>Multiple people have put the answer to this simple problem up here, but I have one thing to add, considering how frustrated I was until I figured out what I was doing wrong.</p>\n\n<p>As mentioned the most straightforward way to do this is like so..</p>\n\n<pre><code>html {\n    position: relative;\n    min-height: 100%;\n}\n\nbody {\n    background-color: transparent;\n    position: static;\n    height: 100%;\n    margin-bottom: 30px;\n}\n\n.site-footer {\n    position: absolute;\n    height: 30px;\n    bottom: 0px;\n    left: 0px;\n    right: 0px;\n}\n</code></pre>\n\n<p>However the property not mentioned in posts, presumably because it is usually default, is the <strong>position: static</strong> on the body tag. Position relative will not work!</p>\n\n<p>My wordpress theme had overridden the default body display and it confused me for an obnoxiously long time.</p>\n'}, {'answer_id': 34146411, 'author': 'gcedo', 'author_id': 1871238, 'author_profile': 'https://Stackoverflow.com/users/1871238', 'pm_score': 6, 'selected': False, 'text': '<h1>Sticky footer with <code>display: flex</code></h1>\n<p>Solution inspired by <a href="https://philipwalton.github.io/solved-by-flexbox/demos/sticky-footer/" rel="noreferrer">Philip Walton\'s sticky footer</a>.</p>\n<h2>Explanation</h2>\n<p>This solution is <a href="https://developer.mozilla.org/en/docs/Web/CSS/flex#Browser_compatibility" rel="noreferrer">valid only for</a>:</p>\n<ul>\n<li>Chrome ≥ 21.0</li>\n<li>Firefox ≥ 20.0</li>\n<li>Internet Explorer ≥ 10</li>\n<li>Safari ≥ 6.1</li>\n</ul>\n<p>It is based on the <a href="https://developer.mozilla.org/en/docs/Web/CSS/flex" rel="noreferrer"><code>flex</code> display</a>, leveraging the <code>flex-grow</code> property, which allows an element to <em>grow</em> in either <strong>height</strong> or <strong>width</strong> (when the <code>flow-direction</code> is set to either <code>column</code> or <code>row</code> respectively), to occupy the extra space in the container.</p>\n<p>We are going to leverage also the <code>vh</code> unit, where <code>1vh</code> is <a href="https://developer.mozilla.org/en/docs/Web/CSS/length#Viewport-percentage_lengths" rel="noreferrer">defined as</a>:</p>\n<blockquote>\n<p>1/100th of the height of the viewport</p>\n</blockquote>\n<p>Therefore a height of <code>100vh</code> it\'s a concise way to tell an element to span the full viewport\'s height.</p>\n<p>This is how you would structure your web page:</p>\n<pre><code>----------- body -----------\n----------------------------\n\n---------- footer ----------\n----------------------------\n</code></pre>\n<p>In order to have the footer stick to the bottom of the page, you want the space between the body and the footer to grow as much as it takes to push the footer at the bottom of the page.</p>\n<p>Therefore our layout becomes:</p>\n<pre><code>----------- body -----------\n----------------------------\n\n---------- spacer ----------\n                             &lt;- This element must grow in height\n----------------------------\n\n---------- footer ----------\n----------------------------\n</code></pre>\n<h2>Implementation</h2>\n<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">\r\n<div class="snippet-code">\r\n<pre class="snippet-code-css lang-css prettyprint-override"><code>body {\n    margin: 0;\n    display: flex;\n    flex-direction: column;\n    min-height: 100vh;\n}\n\n.spacer {\n    flex: 1;\n}\n\n/* make it visible for the purposes of demo */\n.footer {\n    height: 50px;\n    background-color: red;\n}</code></pre>\r\n<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;body&gt;\n    &lt;div class="content"&gt;Hello World!&lt;/div&gt;\n    &lt;div class="spacer"&gt;&lt;/div&gt;\n    &lt;footer class="footer"&gt;&lt;/footer&gt;\n&lt;/body&gt;</code></pre>\r\n</div>\r\n</div>\r\n</p>\n<p>You can play with it at <a href="https://jsfiddle.net/xzchhLjp/" rel="noreferrer">the JSFiddle</a>.</p>\n<h2>Safari quirks</h2>\n<p>Be aware that Safari has a <a href="http://philipwalton.com/articles/normalizing-cross-browser-flexbox-bugs/#minimum-content-sizing-of-flex-items" rel="noreferrer">flawed implementation of the <code>flex-shrink</code> property</a>, which allows items to shrink more than the minimum height that would be required to display the content.\nTo fix this issue you will have to set the <code>flex-shrink</code> property explicitly to 0 to the <code>.content</code> and the <code>footer</code> in the above example:</p>\n<pre class="lang-css prettyprint-override"><code>.content {\n  flex-shrink: 0;\n}\n\n.footer {\n  flex-shrink: 0;\n}\n</code></pre>\n<p>Alternatively, change the <code>flex</code> style for the <code>spacer</code> element into:</p>\n<pre class="lang-css prettyprint-override"><code>.spacer {\n  flex: 1 0 auto;\n}\n</code></pre>\n<p>This 3-value shorthand style is equivalent to the following full setup:</p>\n<pre class="lang-css prettyprint-override"><code>.spacer {\n  flex-grow: 1;\n  flex-shrink: 0;\n  flex-basis: auto;\n}\n</code></pre>\n<p>Elegantly works everywhere.</p>\n'}, {'answer_id': 34823140, 'author': 'DevWL', 'author_id': 2179965, 'author_profile': 'https://Stackoverflow.com/users/2179965', 'pm_score': 0, 'selected': False, 'text': '<p><strong>jQuery CROSS BROWSER CUSTOM PLUGIN - $.footerBottom()</strong></p>\n\n<p>Or use jQuery like I do, and set your footer height to <code>auto</code> or to <code>fix</code>, whatever you like, it will work anyway. this plugin uses jQuery selectors so to make it work, you will have to include the jQuery library to your file.</p>\n\n<p>Here is how you run the plugin. Import jQuery, copy the code of this custom jQuery plugin and import it after importing jQuery! It is very simple and basic, but important. </p>\n\n<p>When you do it, all you have to do is run this code:</p>\n\n<pre><code>$.footerBottom({target:"footer"}); //as html5 tag &lt;footer&gt;.\n// You can change it to your preferred "div" with for example class "footer" \n// by setting target to {target:"div.footer"}\n</code></pre>\n\n<p>there is no need to place it inside the document ready event. It will run well as it is. It will recalculate the position of your footer when the page is loaded and when the window get resized.</p>\n\n<p>Here is the code of the plugin which you do not have to understand. Just know how to implement it. It does the job for you. However, if you like to know how it works, just look through the code. I left comments for you.</p>\n\n<pre><code>//import jQuery library before this script\n</code></pre>\n\n<p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">\r\n<div class="snippet-code">\r\n<pre class="snippet-code-js lang-js prettyprint-override"><code>// Import jQuery library before this script\r\n\r\n// Our custom jQuery Plugin\r\n(function($) {\r\n  $.footerBottom = function(options) { // Or use "$.fn.footerBottom" or "$.footerBottom" to call it globally directly from $.footerBottom();\r\n    var defaults = {\r\n      target: "footer",\r\n      container: "html",\r\n      innercontainer: "body",\r\n      css: {\r\n        footer: {\r\n          position: "absolute",\r\n          left: 0,\r\n          bottom: 0,\r\n        },\r\n\r\n        html: {\r\n          position: "relative",\r\n          minHeight: "100%"\r\n        }\r\n      }\r\n    };\r\n\r\n    options = $.extend(defaults, options);\r\n\r\n    // JUST SET SOME CSS DEFINED IN THE DEFAULTS SETTINGS ABOVE\r\n    $(options.target).css({\r\n      "position": options.css.footer.position,\r\n      "left": options.css.footer.left,\r\n      "bottom": options.css.footer.bottom,\r\n    });\r\n\r\n    $(options.container).css({\r\n      "position": options.css.html.position,\r\n      "min-height": options.css.html.minHeight,\r\n    });\r\n\r\n    function logic() {\r\n      var footerOuterHeight = $(options.target).outerHeight(); // Get outer footer height\r\n      $(options.innercontainer).css(\'padding-bottom\', footerOuterHeight + "px"); // Set padding equal to footer height on body element\r\n      $(options.target).css(\'height\', footerOuterHeight + "!important"); // Set outerHeight of footer element to ... footer\r\n      console.log("jQ custom plugin footerBottom runs"); // Display text in console so ou can check that it works in your browser. Delete it if you like.\r\n    };\r\n\r\n    // DEFINE WHEN TO RUN FUNCTION\r\n    $(window).on(\'load resize\', function() { // Run on page loaded and on window resized\r\n      logic();\r\n    });\r\n\r\n    // RETURN OBJECT FOR CHAINING IF NEEDED - IF NOT DELETE\r\n    // return this.each(function() {\r\n    //   this.checked = true;\r\n    // });\r\n    // return this;\r\n  };\r\n})(jQuery); // End of plugin\r\n\r\n\r\n// USE EXAMPLE\r\n$.footerBottom(); // Run our plugin with all default settings for HTML5</code></pre>\r\n<pre class="snippet-code-css lang-css prettyprint-override"><code>/* Set your footer CSS to what ever you like it will work anyway */\r\nfooter {\r\n  box-sizing: border-box;\r\n  height: auto;\r\n  width: 100%;\r\n  padding: 30px 0;\r\n  background-color: black;\r\n  color: white;\r\n}</code></pre>\r\n<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;\r\n\r\n&lt;!-- The structure doesn\'t matter much, you will always have html and body tag, so just make sure to point to your footer as needed if you use html5, as it should just do nothing run plugin with no settings it will work by default with the &lt;footer&gt; html5 tag --&gt;\r\n&lt;body&gt;\r\n  &lt;div class="content"&gt;\r\n  &lt;header&gt;\r\n    &lt;nav&gt;\r\n      &lt;ul&gt;\r\n        &lt;li&gt;link&lt;/li&gt;\r\n        &lt;li&gt;link&lt;/li&gt;\r\n        &lt;li&gt;link&lt;/li&gt;\r\n        &lt;li&gt;link&lt;/li&gt;\r\n        &lt;li&gt;link&lt;/li&gt;\r\n        &lt;li&gt;link&lt;/li&gt;\r\n      &lt;/ul&gt;\r\n    &lt;/nav&gt;\r\n  &lt;/header&gt;\r\n\r\n  &lt;section&gt;\r\n      &lt;p&gt;&lt;/p&gt;\r\n      &lt;p&gt;Lorem ipsum...&lt;/p&gt;\r\n    &lt;/section&gt;\r\n  &lt;/div&gt;\r\n  &lt;footer&gt;\r\n    &lt;p&gt;Copyright 2009 Your name&lt;/p&gt;\r\n    &lt;p&gt;Copyright 2009 Your name&lt;/p&gt;\r\n    &lt;p&gt;Copyright 2009 Your name&lt;/p&gt;\r\n  &lt;/footer&gt;</code></pre>\r\n</div>\r\n</div>\r\n</p>\n'}, {'answer_id': 35310742, 'author': 'jjr2000', 'author_id': 3412043, 'author_profile': 'https://Stackoverflow.com/users/3412043', 'pm_score': 1, 'selected': False, 'text': '<p>For this question many of the answers I have seen are clunky, hard to implement and inefficient so I thought I\'d take a shot at it and come up with my own solution which is just a tiny bit of css and html</p>\n\n<p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">\r\n<div class="snippet-code">\r\n<pre class="snippet-code-css lang-css prettyprint-override"><code>html,\r\nbody {\r\n  height: 100%;\r\n  margin: 0;\r\n}\r\n.body {\r\n  min-height: calc(100% - 2rem);\r\n  width: 100%;\r\n  background-color: grey;\r\n}\r\n.footer {\r\n  height: 2rem;\r\n  width: 100%;\r\n  background-color: yellow;\r\n}</code></pre>\r\n<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;body&gt;\r\n  &lt;div class="body"&gt;test as body&lt;/div&gt;\r\n  &lt;div class="footer"&gt;test as footer&lt;/div&gt;\r\n&lt;/body&gt;</code></pre>\r\n</div>\r\n</div>\r\n</p>\n\n<p>this works by setting the height of the footer and then using css calc to work out the minimum height the page can be with the footer still at the bottom, hope this helps some people :)</p>\n'}, {'answer_id': 39199515, 'author': 'user1235285', 'author_id': 1235285, 'author_profile': 'https://Stackoverflow.com/users/1235285', 'pm_score': 0, 'selected': False, 'text': '<p>An old thread I know, but if you are looking for a responsive solution, this jQuery addition will help: </p>\n\n<pre><code>$(window).on(\'resize\',sticky);\n$(document).bind("ready", function() {\n   sticky();\n});\n\nfunction sticky() {\n   var fh = $("footer").outerHeight();\n   $("#push").css({\'height\': fh});\n   $("#wrapper").css({\'margin-bottom\': -fh});\n}\n</code></pre>\n\n<p>Full guide can be found here: <a href="https://pixeldesigns.co.uk/blog/responsive-jquery-sticky-footer/" rel="nofollow">https://pixeldesigns.co.uk/blog/responsive-jquery-sticky-footer/</a></p>\n'}, {'answer_id': 39449537, 'author': 'Ravinder Payal', 'author_id': 2988776, 'author_profile': 'https://Stackoverflow.com/users/2988776', 'pm_score': 0, 'selected': False, 'text': '<p>I have created a very simple library <a href="https://github.com/ravinderpayal/FooterJS" rel="nofollow">https://github.com/ravinderpayal/FooterJS</a> </p>\n\n<p>It is very simple in use. After including library, just call this line of code. </p>\n\n<pre><code>footer.init(document.getElementById("ID_OF_ELEMENT_CONTAINING_FOOTER"));\n</code></pre>\n\n<p>Footers can be dynamically changed by recalling above function with different parameter/id. </p>\n\n<pre><code>footer.init(document.getElementById("ID_OF_ANOTHER_ELEMENT_CONTAINING_FOOTER"));\n</code></pre>\n\n<p>Note:- You haven\'t to alter or add any CSS. Library is dynamic which implies that even if screen is resized after loading page it will reset the position of footer. I have created this library, because CSS solves the problem for a while but when size of display changes significantly,from desktop to tablet or vice versa, they either overlap the content or they no longer remains sticky.</p>\n\n<p>Another solution is CSS Media Queries, but you have to manually write different CSS styles for different size of screens while this library does its work automatically and is supported by all basic JavaScript supporting browser.</p>\n\n<p><strong>Edit</strong>\nCSS solution:</p>\n\n<pre><code>@media only screen and (min-height: 768px) {/* or height/length of body content including footer*/\n    /* For mobile phones: */\n    #footer {\n        width: 100%;\n        position:fixed;\n        bottom:0;\n    }\n}\n</code></pre>\n\n<p>Now, if the height of display is more than your content length, we will make footer fixed to bottom and if not, it will automatically appear in very end of display as you need to scroll to view this.</p>\n\n<p>And, it seems a better solution than JavaScript/library one.</p>\n'}, {'answer_id': 44682287, 'author': 'Laughing Horse', 'author_id': 6391229, 'author_profile': 'https://Stackoverflow.com/users/6391229', 'pm_score': 0, 'selected': False, 'text': "<p>I wasn't having any luck with the solutions suggested on this page before but then finally, this little trick worked. I'll include it as another possible solution.</p>\n\n<pre><code>footer {\n  position: fixed;\n  right: 0;\n  bottom: 0;\n  left: 0;\n  padding: 1rem;\n  background-color: #efefef;\n  text-align: center;\n}\n</code></pre>\n"}, {'answer_id': 44771365, 'author': 'Reggie Pinkham', 'author_id': 2927114, 'author_profile': 'https://Stackoverflow.com/users/2927114', 'pm_score': 0, 'selected': False, 'text': '<p>For natural header and footer heights use CSS Flexbox.</p>\n<p><a href="https://jsfiddle.net/Lsb6dk14/" rel="nofollow noreferrer">See JS Fiddle</a>.</p>\n<p><strong>HTML</strong></p>\n<pre><code>&lt;body&gt;\n  &lt;header&gt;\n    ...\n  &lt;/header&gt;\n  &lt;main&gt;\n    ...\n  &lt;/main&gt;\n  &lt;footer&gt;\n    ...\n  &lt;/footer&gt;\n&lt;/body&gt;  \n</code></pre>\n<p><strong>CSS</strong></p>\n<pre><code>html {\n  height: 100%;\n}\n\nbody {\n  height: 100%;\n  min-height: 100vh;\n  overflow-y: auto;\n  -webkit-overflow-scrolling: touch;\n  margin: 0;\n  display: flex;\n  flex-direction: column;\n}\n\nmain {\n  flex-grow: 1;\n  flex-shrink: 0;\n}\n\nheader,\nfooter {\n  flex: none;\n}\n</code></pre>\n'}, {'answer_id': 45021713, 'author': 'Daniel Alsaker', 'author_id': 5872527, 'author_profile': 'https://Stackoverflow.com/users/5872527', 'pm_score': 2, 'selected': False, 'text': "<p>I have myself struggled with this sometimes and I always found that the solution with all those div's within each other was a messy solution. \nI just messed around with it a bit, and I personally found out that this works and it certainly is one of the simplest ways:</p>\n\n<pre><code>html {\n    position: relative;\n}\n\nhtml, body {\n    margin: 0;\n    padding: 0;\n    min-height: 100%;\n}\n\nfooter {\n    position: absolute;\n    bottom: 0;\n}\n</code></pre>\n\n<p>What I like about this is that no extra HTML needs to be applied. You can simply add this CSS and then write your HTML as whenever</p>\n"}, {'answer_id': 47489319, 'author': 'juan Isaza', 'author_id': 2394901, 'author_profile': 'https://Stackoverflow.com/users/2394901', 'pm_score': 0, 'selected': False, 'text': '<p>For me the nicest way of displaying it (the footer) is sticking to the bottom but not covering content all the time:</p>\n\n<pre><code>#my_footer {\n    position: static\n    fixed; bottom: 0\n}\n</code></pre>\n'}, {'answer_id': 47640893, 'author': 'Temani Afif', 'author_id': 8620333, 'author_profile': 'https://Stackoverflow.com/users/8620333', 'pm_score': 3, 'selected': False, 'text': '<p>A similar solution to <a href="https://stackoverflow.com/a/34146411/8620333">@gcedo</a> but without the need of adding an intermediate content in order to push the footer down. We can simply add <code>margin-top:auto</code> to the footer and it will be pushed to the bottom of the page regardless his height or the height of the content above.</p>\n\n<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">\r\n<div class="snippet-code">\r\n<pre class="snippet-code-css lang-css prettyprint-override"><code>body {\r\n  display: flex;\r\n  flex-direction: column;\r\n  min-height: 100vh;\r\n  margin:0;\r\n}\r\n\r\n.content {\r\n  padding: 50px;\r\n  background: red;\r\n}\r\n\r\n.footer {\r\n  margin-top: auto;\r\n  padding:10px;\r\n  background: green;\r\n}</code></pre>\r\n<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="content"&gt;\r\n  some content here\r\n&lt;/div&gt;\r\n&lt;footer class="footer"&gt;\r\n  some content\r\n&lt;/footer&gt;</code></pre>\r\n</div>\r\n</div>\r\n</p>\n'}, {'answer_id': 52106754, 'author': 'Roger', 'author_id': 558193, 'author_profile': 'https://Stackoverflow.com/users/558193', 'pm_score': 0, 'selected': False, 'text': '<p>The flex solutions worked for me as far as making the footer sticky, but unfortunately changing the body to use flex layout made some of our page layouts change, and not for the better. What finally worked for me was:</p>\n\n<pre><code>    jQuery(document).ready(function() {\n\n    var fht = jQuery(\'footer\').outerHeight(true);\n    jQuery(\'main\').css(\'min-height\', "calc(92vh - " + fht + "px)");\n\n});\n</code></pre>\n\n<p>I got this from ctf0\'s response at <a href="https://css-tricks.com/couple-takes-sticky-footer/" rel="nofollow noreferrer">https://css-tricks.com/couple-takes-sticky-footer/</a></p>\n'}, {'answer_id': 52440647, 'author': 'VXp', 'author_id': 2851632, 'author_profile': 'https://Stackoverflow.com/users/2851632', 'pm_score': 2, 'selected': False, 'text': '<p>Since the <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Grid_Layout" rel="nofollow noreferrer">Grid</a> solution hasn\'t been presented yet, here it is, with just two <em>declarations</em> for the <em>parent element</em>, if we take the <code>height: 100%</code> and <code>margin: 0</code> for granted:</p>\n\n<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">\r\n<div class="snippet-code">\r\n<pre class="snippet-code-css lang-css prettyprint-override"><code>html, body {height: 100%}\r\n\r\nbody {\r\n  display: grid; /* generates a block-level grid */\r\n  align-content: space-between; /* places an even amount of space between each grid item, with no space at the far ends */\r\n  margin: 0;\r\n}\r\n\r\n.content {\r\n  background: lightgreen;\r\n  /* demo / for default snippet window */\r\n  height: 1em;\r\n  animation: height 2.5s linear alternate infinite;\r\n}\r\n\r\nfooter {background: lightblue}\r\n\r\n@keyframes height {to {height: 250px}}</code></pre>\r\n<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="content"&gt;Content&lt;/div&gt;\r\n&lt;footer&gt;Footer&lt;/footer&gt;</code></pre>\r\n</div>\r\n</div>\r\n</p>\n\n<ul>\n<li><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/align-content" rel="nofollow noreferrer"><code>align-content: space-between</code></a></li>\n</ul>\n\n<blockquote>\n  <p>The items are evenly distributed within the alignment container along\n  the cross axis. The spacing between each pair of adjacent items is the\n  same. The first item is flush with the main-start edge, and the last\n  item is flush with the main-end edge.</p>\n</blockquote>\n'}, {'answer_id': 53919076, 'author': 'antelove', 'author_id': 7656367, 'author_profile': 'https://Stackoverflow.com/users/7656367', 'pm_score': 1, 'selected': False, 'text': '<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">\r\n<div class="snippet-code">\r\n<pre class="snippet-code-css lang-css prettyprint-override"><code>div.fixed {\r\n   position: fixed;\r\n   bottom: 0;\r\n   right: 0;\r\n   width: 100%;\r\n   border: 3px solid #73AD21;\r\n}</code></pre>\r\n<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;body style="height:1500px"&gt;\r\n\r\n   &lt;h2&gt;position: fixed;&lt;/h2&gt;\r\n\r\n   &lt;p&gt;An element with position: fixed; is positioned relative to the viewport, which means it always stays in the same place even if the page is scrolled:&lt;/p&gt;\r\n\r\n   &lt;div class="fixed"&gt;\r\n      This div element has position: fixed;\r\n   &lt;/div&gt;\r\n\r\n&lt;/body&gt;</code></pre>\r\n</div>\r\n</div>\r\n</p>\n'}, {'answer_id': 58892044, 'author': 'kiko carisse', 'author_id': 5045446, 'author_profile': 'https://Stackoverflow.com/users/5045446', 'pm_score': 1, 'selected': False, 'text': "<p>If you don't want it using position fixed, and following you annoyingly on mobile, this seems to be working for me so far.</p>\n\n<pre><code>html {\n    min-height: 100%;\n    position: relative;\n}\n\n#site-footer {\n    position: absolute;\n    bottom: 0;\n    left: 0;\n    width: 100%;\n    padding: 6px 2px;\n    background: #32383e;\n}\n</code></pre>\n\n<p>Just set the html to <code>min-height: 100%;</code> and <code>position: relative;</code>, then <code>position: absolute; bottom: 0; left: 0;</code> on the footer. I then made sure the footer was the last element in the body.</p>\n\n<p>Let me know if this doesn't work for anyone else, and why. I know these tedious style hacks can behave strangely among various circumstances I'd not thought of.</p>\n"}, {'answer_id': 63382499, 'author': 'cssyphus', 'author_id': 1447509, 'author_profile': 'https://Stackoverflow.com/users/1447509', 'pm_score': 0, 'selected': False, 'text': '<h1>REACT-friendly solution - (no spacer div required)</h1>\n<p>Chris Coyier (the venerable CSS-Tricks website) has kept his <a href="https://css-tricks.com/couple-takes-sticky-footer/" rel="nofollow noreferrer">page on the Sticky-Footer</a> up-to-date, with at least FIVE methods now for creating a sticky footer, including using FlexBox and CSS-Grid.</p>\n<p>Why is this important? Because, for me, the earlier/older methods I used for years did not work with React - I had to use Chris\' flexbox solution - which was <em><strong>easy</strong></em> and <em><strong>worked</strong></em>.</p>\n<p>Below is his <a href="https://css-tricks.com/couple-takes-sticky-footer/#there-is-flexbox" rel="nofollow noreferrer">CSS-Tricks flexbox Sticky Footer</a> - just look at the code below, it cannot possibly be simpler.</p>\n<p><em>(The (below) StackSnippet example does not perfectly render the bottom of the example. The footer is shown extending past the bottom of the screen, which does not happen in real life.)</em></p>\n<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">\r\n<div class="snippet-code">\r\n<pre class="snippet-code-css lang-css prettyprint-override"><code>html,body{height: 100%;}\nbody     {display:flex; flex-direction:column;}\n.content {flex: 1 0 auto;} /* flex: grow / shrink / flex-basis; */\n.footer  {flex-shrink: 0;}\n\n/* ---- BELOW IS ONLY for demo ---- */\n.footer{background: palegreen;}</code></pre>\r\n<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;body&gt;\n  &lt;div class="content"&gt;Page Content - height expands to fill space&lt;/div&gt;\n  &lt;footer class="footer"&gt;Footer Content&lt;/footer&gt;\n&lt;/body&gt;</code></pre>\r\n</div>\r\n</div>\r\n</p>\n<p>Chris also demonstrates this <a href="https://css-tricks.com/couple-takes-sticky-footer/#there-is-grid" rel="nofollow noreferrer">CSS-Grid solution</a> for those who prefer grid.</p>\n<hr />\n<h3>References:</h3>\n<p><a href="https://css-tricks.com/snippets/css/a-guide-to-flexbox/" rel="nofollow noreferrer">CSS-Tricks - A Complete Guide to Flexbox</a></p>\n'}, {'answer_id': 65774517, 'author': 'Juliano Suman Curti', 'author_id': 14145197, 'author_profile': 'https://Stackoverflow.com/users/14145197', 'pm_score': 0, 'selected': False, 'text': '<p>Have a look at <a href="http://1linelayouts.glitch.me/" rel="nofollow noreferrer">http://1linelayouts.glitch.me/</a>, example 4. Una Kravets nails this problem.</p>\n<p>This creates a 3 layer page with header, main and footer.</p>\n<p>-Your footer will always stay at the bottom, and use space to fit the content;</p>\n<p>-Your header will always stay at the top, and use space to fit the content;</p>\n<p>-Your main will always use all the available remaining space (remaining fraction of space), enough to fill the screen, if need.</p>\n<h2>HTML</h2>\n<pre><code>&lt;div class=&quot;parent&quot;&gt;\n  &lt;header class=&quot;blue section&quot; contenteditable&gt;Header&lt;/header&gt;\n  &lt;main class=&quot;coral section&quot; contenteditable&gt;Main&lt;/main&gt;\n  &lt;footer class=&quot;purple section&quot; contenteditable&gt;Footer Content&lt;/footer&gt;\n&lt;/div&gt;\n    \n</code></pre>\n<h2>CSS</h2>\n<pre><code>.parent {\n  display: grid;\n  height: 95vh; /* no scroll bars if few content */\n  grid-template-rows: auto 1fr auto;\n}\n    \n</code></pre>\n'}, {'answer_id': 67166444, 'author': 'siaeva', 'author_id': 3494114, 'author_profile': 'https://Stackoverflow.com/users/3494114', 'pm_score': 2, 'selected': False, 'text': '<p>Just invented a very simple solution that worked great for me. You just wrap all page content except for the footer within in a div, and then set the min-height to 100% of the viewpoint minus the height of the footer. No need for absolute positioning on the footer or multiple wrapper divs.</p>\n<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">\r\n<div class="snippet-code">\r\n<pre class="snippet-code-css lang-css prettyprint-override"><code>.page-body {min-height: calc(100vh - 400px);} /*Replace 400px with your footer height*/</code></pre>\r\n</div>\r\n</div>\r\n</p>\n'}, {'answer_id': 67828478, 'author': 'Matt', 'author_id': 10266312, 'author_profile': 'https://Stackoverflow.com/users/10266312', 'pm_score': 1, 'selected': False, 'text': '<p>On my sites I always use:</p>\n<pre><code>position: fixed;\n</code></pre>\n<p>...in my CSS for a footer. That anchors it to the bottom of the page.</p>\n'}, {'answer_id': 69988420, 'author': 'DINA TAKLIT', 'author_id': 9039646, 'author_profile': 'https://Stackoverflow.com/users/9039646', 'pm_score': 0, 'selected': False, 'text': '<p>A quick easy solution by using flex</p>\n<ul>\n<li>Give the <code>html</code> and <code>body</code> a height of <code>100%</code></li>\n</ul>\n<pre class="lang-css prettyprint-override"><code>html,\nbody {\n  width: 100%;\n  height: 100%;\n}\n</code></pre>\n<ul>\n<li>Display the body as <code>flex</code> with <code>column</code> direction:</li>\n</ul>\n<pre class="lang-css prettyprint-override"><code>body { \n  min-height: 100%;\n  display: flex;\n  flex-direction: column;\n}\n</code></pre>\n<ul>\n<li>Add <code>flex-grow: 1</code> for the main</li>\n</ul>\n<pre class="lang-css prettyprint-override"><code>main {\n  flex-grow: 1;\n}\n</code></pre>\n<blockquote>\n<p><code>flex-grow</code> specifies how much of the remaining space in the flex container should be assigned to the item (the flex grow factor).</p>\n</blockquote>\n<p><div class="snippet" data-lang="js" data-hide="true" data-console="true" data-babel="false">\r\n<div class="snippet-code snippet-currently-hidden">\r\n<pre class="snippet-code-css lang-css prettyprint-override"><code>*, \n*::after,\n*::before{\n  margin: 0;\n  padding: 0;\n  box-sizing: border-box;\n}\nhtml,\nbody {\n  width: 100%;\n  height: 100%;\n}\n\nbody {\n  min-height: 100%;\n  display: flex;\n  flex-direction: column;\n}\n\nmain {\n  flex-grow: 1;\n}\n\nfooter{\n  background-color: black;\n  color: white;\n  padding: 1rem 0;\n  display: flex; \n  justify-content: center;\n  align-items: center;\n}</code></pre>\r\n<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;body&gt; \n    &lt;main&gt;\n        &lt;section &gt;\n            Hero\n        &lt;/section&gt;\n    &lt;/main&gt;\n\n    &lt;footer &gt;\n        &lt;div&gt;\n            &lt;p &gt; &amp;copy; Copyright 2021&lt;/p&gt;\n        &lt;/div&gt;\n    &lt;/footer&gt;\n&lt;/body&gt;</code></pre>\r\n</div>\r\n</div>\r\n</p>\n'}, {'answer_id': 73325579, 'author': 'Shubham Sarda', 'author_id': 7846238, 'author_profile': 'https://Stackoverflow.com/users/7846238', 'pm_score': 0, 'selected': False, 'text': '<p>Keeping your <code>&lt;main&gt;</code> as min-height 90vh will solve your problem forever.\nHere is the base structure that will help you follow semantics and cover entire page.</p>\n<p><strong>Step 1:</strong> Keep everything inside the main tag except the header and footer.</p>\n<pre><code>&lt;body&gt;\n    &lt;header&gt;\n        &lt;!╌ nav, logo ╌&gt; \n    &lt;/header&gt;\n    &lt;main&gt;\n        &lt;!╌ section and div ╌&gt; \n    &lt;/main&gt;\n    &lt;footer&gt;\n        &lt;!╌ nav, logo ╌&gt;\n    &lt;/footer&gt;\n&lt;/body&gt;\n</code></pre>\n<p><strong>Step 2:</strong> Add min-height: 90vh for main</p>\n<pre><code>main{\n    min-height: 90vh;\n}\n</code></pre>\n<p>Usually, header and footer are 70px minimum in height so this case works well, tried and tested!</p>\n'}]
['https://Stackoverflow.com/questions/42294', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1288/']