How to create a fixed/sticky footer with CSS?

CSSWeb DevelopmentFront End Technology

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

Example

 Live Demo

<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
   body{
      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;
   }
</style>
</head>
<body>
<h1>Fixed/Sticky Footer Example</h1>
<div class="footer">
<p>All rights reserved ©</p>
</div>
</body>
</html>

Output

The above code will produce the following output −

raja
Published on 07-May-2020 16:16:15
Advertisements