-2

I have a simple landing page with a fullscreen background image and no other content. However, when I load this, the footer comes all the way up to the Navbar and stops the image from being fullscreen (image is fullscreen on pages with content). This is how it looks: https://i.stack.imgur.com/CtK4K.png

My CSS for the background image is the following:

.index {
  background: url('/Content/images/home2.jpg') no-repeat center center;
  background-size: cover;
  min-height: 100%;
  padding-top: 20px;
  padding-bottom: 20px;
}

Also, my Navbar is getting in the way of this image which I also need to rectify.

Felix Edelmann
  • 4,959
  • 3
  • 28
  • 34
JoeOKelly
  • 19
  • 5

3 Answers3

0

Add this to your style:

position: fixed;
bottom: 0;
0

you can put : footer{position:absolute; bottom:0;}

CodePen

Yassine
  • 76
  • 1
  • 8
0

Or you can wrap everything else except footer in a div, then give it a

min-height: calc(100vh - 70px);

Change 70px to the real height of your footer.

Michael Lihs
  • 7,460
  • 17
  • 52
  • 85
GUAN YIXI
  • 1
  • 1