Home > database >  Footer is not sticking to the bottom [Rails 7 Boostrap]
Footer is not sticking to the bottom [Rails 7 Boostrap]

Time:03-09

This is my custom

@import 'bootstrap/scss/bootstrap';
@import 'bootstrap-icons/font/bootstrap-icons';

footer {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    background-color: red;
    color: white;
    text-align: center;
 }

and my page is like

  <body>

  <%= render "layouts/navigations"%>
  
  <div >
   <%= render "layouts/messages"%>
      <%= yield %>
  </div>
  
  <%= render "layouts/footer"%>

  </body>
<footer >
  <!-- Copyright -->
  <div  ">
    © 2022 Copyright:
  </div>
  <!-- Copyright -->
</footer>

Not sure why it does not work with my app (but actually previously worked in my old rails 6 app. Really sorry for this simple question as I just came back to try learning web app again and getting stuck with this kind of issue.

CodePudding user response:

It is working fine in this example. Please provide the working example so that we can find what is causing the issue.

footer {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    background-color: red;
    color: white;
    text-align: center;
}
.container {
    background: #d9fbff;
    height: 900px;
    padding: 0;
}
<html>
<body>
  
  <div >
  </div>

  <footer >
  <div >
    © 2022 Copyright:
  </div>
  </footer>

  </body>
</html>

  • Related