1

I've inserted one of the pre-made footers into my template. The footer is usually within a block. However the most annoying this is that when there is little content the footer comes up, but with lots of content it remains at the bottom. How do I get it to stay at the bottom?

.footer-basic {
  background:#262324;
  bottom:0;
  width:100%;
  position:fixed;
}

* {
  -webkit-box-sizing:border-box;
  -moz-box-sizing:border-box;
  box-sizing:border-box;
}

body {
  font-family:"Open Sans","Helvetica Neue",Helvetica,Arial,sans-serif;
  font-size:14px;
  line-height:1.42857143;
  color:#666666;
  background-color:#ffffff;
}

html {
  font-family:sans-serif;
  -ms-text-size-adjust:100%;
  -webkit-text-size-adjust:100%;
}

html {
  font-size:10px;
  -webkit-tap-highlight-color:rgba(0,0,0,0);
}
Hosh Adf
  • 83
  • 1
  • 2
  • 9
  • Possible duplicate of [Flushing footer to bottom of the page, twitter bootstrap](http://stackoverflow.com/questions/10099422/flushing-footer-to-bottom-of-the-page-twitter-bootstrap) – ganchito55 Mar 27 '17 at 00:10

2 Answers2

1

Target the footer element and make

 position:fixed;
 bottom: 0;

Make sure to keep this order. It is crucial as CSS is Cascading and will not read the bottom: 0 if a position has not been previously defined.

Then make the container have a minimum height of 100vh.

0

Adding this to the body works for me: display: grid; grid-template-rows: 1fr auto;

Iceflower S
  • 144
  • 3
  • 18