force footer on bottom on pages with little content

This Flexbox solution is neater and far easier to implement: HTML <body> <div class=”content”> content </div> <footer class=”footer”></footer> </body> CSS html, body { height: 100%; } body { display: flex; flex-direction: column; } .content { flex: 1 0 auto; } .footer { flex-shrink: 0; } Just ensure you wrap the necessary divs inside the body.

CSS – Sticky footer [duplicate]

Modern Clean CSS “Sticky Footer” from James Dean HTML <!DOCTYPE html> <head> <title></title> </head> <body> <nav></nav> <article>Lorem ipsum…</article> <footer></footer> </body> </html> CSS html { position: relative; min-height: 100%; } body { margin: 0 0 100px; /* bottom = footer height */ } footer { position: absolute; left: 0; bottom: 0; height: 100px; width: 100%; } … Read more

pure CSS multiple stacked position sticky?

You need to make all the elements to stick to the same container (containing block) by adding some offsets. Here is a basic example where the elements will stick to the body: body { margin:0; min-height:200vh; border:2px solid; } .first { height:50px; background:red; position:sticky; top:0; } .second { height:50px; background:blue; position:sticky; top:52px; } .third { … Read more