How to make a sticky footer?

I think I figured out the answer. In your footer.php file add a div like that goes outside the footer and assign your footer class to it. For example,

<div class="sticky-footer">
<footer id="colophon" class="site-footer">
<div class="site-info">
<?php
/* translators: 1: Theme name, 2: Theme author. */
printf( esc_html__( 'Theme: %1$s by %2$s.', 'best' ), 'best', '<a href="http://underscores.me/">Underscores.me</a>' );
?>
</div><!-- .site-info -->
</footer><!-- #colophon -->
</div><!-- #page -->
</div>

And the correct style is :


.sticky-footer {
    padding:2em;
    bottom:0;
    clear:both;
    background-color:black;
    color:white;
    position:static;
    width:100%;
}