How to make a sticky footer?

How to make a sticky footer 

By using absolute, the footer and main Container are subject to where you put them. If you use absolute and set the footer to the bottom, it will just stick to the bottom of the viewport. 

Example : 

HTML Code:
 
<html>
<title>Sticky Footer</title>
<head></head>
<body>
  <header>
  </header>
  <main>
  </main>
  <footer></footer>
</body>
</html>

Css Code:

body {
   width: 100%;
   height: 600px;
   color:#fff;
footer {
   width: 100%;
   color: #333;
   height: 60px;
   position: absolute;
   bottom: 0;

That way, the footer always has enough room and is set to the bottom. 

Comments

Popular posts from this blog

How to install and configure Alphabetic Pagination WordPress Plugin?

How to Add Google Web Fonts in WordPress Themes the “Right” way

How to check if it is WooCommerce page?