0

I make a footer positioned absolute to the bottom

<div class="footer">
     <p class="text-center" style="padding-top: 70px">Copy Right www.example.com </p>
</div>

footer, .footer {
    position: absolute;
    width: 100%;
    height:20%;
    color: rgba(255,255,255,0.75);
    background-color: #24292e;
}

The footer works properly if the content is long enough, else the content is short the footer will float far beyond the bottom line

I tried to set position: fixed in which situation the footer follows the mouse to scroll.

How could I fix the footer to bottom but not following the mouse.

AbstProcDo
  • 19,953
  • 19
  • 81
  • 138

1 Answers1

1

Remove the style="padding-top: 70px" and add the following CSS code to the footer class.

 .footer {
        position: fixed;
        left: 0;
        bottom: 0;
        width: 100%;
        background-color: #24292e;
        color: rgba(255,255,255,0.75);
        text-align: center;
    }

This should work.

ZombieChowder
  • 1,187
  • 12
  • 36