skip to Main Content

For some reason, it only works on the home page. Any suggestions? One more thing, the site is here: https://captainsapphire.github.io/
(Ignore the other issues for right now).

#footer-container {
  align-items: center;
  justify-content: center;
}

footer {
  background-color: #1D3557;
  color: #E63946;
  position: absolute;
  margin-bottom: 0;
  width: 100%;
  height: 4rem;
}

footer address {
  float: left;
  padding-top: 2%;
  padding-right: 2%;
}

#footer-image {
  width: 40px;
  height: 40px;
  float: right;
  padding-top: 2%;
  padding-right: 2%;
}
<div>
  <footer id="footer-container">
    <address>[email protected]</address>
    <a href="https://www.artfol.co/captain_sapphire" target="_blank"><img src="https://github.com/CaptainSapphire/captainsapphire.github.io/blob/main/images/artfollogo.png?raw=true" id="footer-image"></a>
  </footer>
</div>

2

Answers


  1. This should help, I removed position: absolute from #footer-container and added margin-top: auto to push it to the bottom and I edited some padding values.

    #footer-container {
      display: flex;
      align-items: center;
      justify-content: space-between;
      background-color: #1D3557;
      color: #E63946;
      height: 4rem;
      width: 100%;
      margin-top: auto;
    }
    
    footer address {
      padding-top: 2%;
      padding-left: 2%;
    }
    
    #footer-image {
      width: 40px;
      height: 40px;
      padding-right: 2%;
    }
    
    <div id="footer-container">
        <address>[email protected]</address>
        <a href="https://www.artfol.co/captain_sapphire" target="_blank">
          <img src="https://github.com/CaptainSapphire/captainsapphire.github.io/blob/main/images/artfollogo.png?raw=true" id="footer-image">
        </a>
    </div>
    
    
    
    Login or Signup to reply.
  2. I saw your code, if you add bottom: 0px; and position: fixed; to footer style, your footer will stick to the bottom of the page.

    #footer-container {
      align-items: center;
      justify-content: center;
    }
    
    footer {
      background-color: #1D3557;
      color: #E63946;
      position: absolute;
      margin-bottom: 0;
      width: 100%;
      height: 4rem;
      position: fixed;
      bottom: 0px;
    }
    
    footer address {
      float: left;
      padding-top: 2%;
      padding-right: 2%;
    }
    
    #footer-image {
      width: 40px;
      height: 40px;
      float: right;
      padding-top: 2%;
      padding-right: 2%;
    }
    <div>
      <footer id="footer-container">
        <address>[email protected]</address>
        <a href="https://www.artfol.co/captain_sapphire" target="_blank"><img src="https://github.com/CaptainSapphire/captainsapphire.github.io/blob/main/images/artfollogo.png?raw=true" id="footer-image"></a>
      </footer>
    </div>
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search