1

I want to make the footer position at the bottom of the page. My code for footer is...

footer{
  height: 80px;
  background-color: rgb(93, 158, 255);
  color: white;
  text-align: center;
  position: relative;
  bottom: 0;
}
<html>
<body>
  <footer>
    <div class="footer">
      <h5>Copyrigth &copy;
        <script type="text/javascript">
          document.write(new Date().getFullYear());
        </script>
      </h5>
      <h5>Designed by:  - Junior Web Development</h5>
    </div>
  </footer>
</body>
</html>

Result is index.php

aridlehoover
  • 3,139
  • 1
  • 26
  • 24
usern
  • 9
  • 4

2 Answers2

0

Maybe this would work for you.

footer{
    height: 120px;
    background-color: rgb(93, 158, 255);
    color:white;
    text-align: center;
    bottom: 0;
    position: fixed;
    width: 100%
}
Adil Ahmed
  • 395
  • 1
  • 11
0

i think you forgot the dot in css class .footer, and you should use position: absolute;

here a working example, useful info about Css Layout

.footer{
    position: absolute;
    bottom: 0;
}
<div class="footer">
    <h5>Copyrigth &copy;
    <script type="text/javascript">
    document.write(new Date().getFullYear());
    </script>
    </h5>
    <div>
        <h5>Designed by:  - Junior Web Development</h5>
    </div> 
    </div>