How to create a fixed/sticky footer with CSS?

To create fixed footer with CSS, the code is as follows −


 Live Demo

<!DOCTYPE html>
<meta name="viewport" content="width=device-width, initial-scale=1">
      font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
   .footer {
      font-size: 20px;
      position: fixed;
      left: 0;
      bottom: 0;
      width: 100%;
      background-color: rgb(50, 6, 100);
      color: white;
      text-align: center;
<h1>Fixed/Sticky Footer Example</h1>
<div class="footer">
<p>All rights reserved ©</p>


The above code will produce the following output −