1

I have a div class .footer which is my website's footer till now I do not have any content on my webpage so it is on the top of my page after my navigation. please tell some CSS so I can make my footer at the bottom of my page.

Fabian
  • 650
  • 2
  • 9
  • 21
Sumit Kumar
  • 493
  • 2
  • 5
  • 16

3 Answers3

1

Using position:fixed on footer and setting bottom:0 will position ur footer at the bottom of screen

More about CSS positions here

footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background-color: red;
}
<footer>
  some content
</footer>
Gautam Naik
  • 8,990
  • 3
  • 27
  • 42
1

This is the code I used in order to do that:

#footer{
  position: absolute;
  height: 75px;
  bottom: 0;
}
Jordy
  • 320
  • 2
  • 15
0

Use

position: fixed;
bottom: 0;

position: fixed; will get the position fixed while scrolling & bottom:0 will keep the element at bottom of window.

    .footer{
        position: fixed;
        bottom: 0;
        width:100%;
        height:40px;
        background-color:red;
    }
    
    .header{
        width:100%;
        height:40px;
        background-color:green;
    }
<div class="header">
       Header
</div>

<div class="footer">
    Footer
</div>
Atul Sharma
  • 9,397
  • 10
  • 38
  • 65