Home > Back-end >  My footer is creating mini horizontal scroll
My footer is creating mini horizontal scroll

Time:08-09

im working in my final proyect to become a Web Developer, and im struggling with my footer, that is creating a minimum horizontal scroll and I cant find why.

I've been doing tests and I can't get rid of that horizontal scroll. An answer as soon as possible would be of great help to me, since this is my final project.

footer {
  position: absolute;
  bottom: 100;
  left: 0;
  right: 0;
  background: #111;
  height: auto;
  width: 100%;
  padding-top: 40px;
  color: #fff;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  h3 {
    font-size: 2rem;
    font-weight: 500;
    text-transform: capitalize;
    line-height: 4rem;
    color: yellow;
  }
}

.socials {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  li {
    margin: 0 0px;
  }
  a {
    text-decoration: none;
    color: #fff;
    padding: 5px;
    &:hover {
      color: rgb(255, 251, 0);
      transition-duration: 1s;
    }
  }
}

.footer-bottom {
  background: #000;
  width: 100%;
  padding: 20px;
  padding-bottom: 40px;
  text-align: center;
  p {
    display: flex;
    justify-content: flex-start;
    font-size: 14px;
    word-spacing: 2px;
    text-transform: capitalize;
    a {
      color: yellow;
      font-size: 16px;
      text-decoration: none;
    }
  }
}

@media (max-width: 830px) {
  .socials li {
    font-size: 14px;
  }
}
<footer>
  <div >
    <h3>KURT BURGERS</h3>
    <ul >
      <li><a href="https://www.mardelplata.gob.ar/defensadelconsumidor">DEFENSA AL CONSUMIDOR</a></li>
      <li><a href="https://www.rappi.com.ar/">DELIVERY</a></li>
      <li><a href="paginas/politicasprivacidad.html">POLITICAS DE PRIVACIDAD</a></li>
    </ul>
  </div>
  <div >
    <p>copyright &copy; <a href="#">KURT BURGERS</a> </p>
  </div>
</footer>

CodePudding user response:

You are missing this from your styles:

* {
    box-sizing: border-box;
}

CodePudding user response:

Add this to your CSS:

body, html {
  margin: 0 !important;
  overflow-x: hidden;
}

See the snippet below.

body,
html {
  margin: 0 !important;
  overflow-x: hidden;
}

footer {
  position: absolute;
  bottom: 100;
  left: 0;
  right: 0;
  background: #111;
  height: auto;
  width: 100%;
  padding-top: 40px;
  color: #fff;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
}

.footer-content h3 {
  font-size: 2rem;
  font-weight: 500;
  text-transform: capitalize;
  line-height: 4rem;
  color: yellow;
}

.socials {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.socials li {
  margin: 0 0px;
}

.socials a {
  text-decoration: none;
  color: #fff;
  padding: 5px;
}

.socials a:hover {
  color: #fffb00;
  transition-duration: 1s;
}

.footer-bottom {
  background: #000;
  width: 100%;
  padding: 20px;
  padding-bottom: 40px;
  text-align: center;
}

.footer-bottom p {
  display: flex;
  justify-content: flex-start;
  font-size: 14px;
  word-spacing: 2px;
  text-transform: capitalize;
}

.footer-bottom p a {
  color: yellow;
  font-size: 16px;
  text-decoration: none;
}

@media (max-width: 830px) {
  .socials li {
    font-size: 14px;
  }
}
<footer>
  <div >
    <h3>KURT BURGERS</h3>
    <ul >
      <li><a href="https://www.mardelplata.gob.ar/defensadelconsumidor">DEFENSA AL CONSUMIDOR</a></li>
      <li><a href="https://www.rappi.com.ar/">DELIVERY</a></li>
      <li><a href="paginas/politicasprivacidad.html">POLITICAS DE PRIVACIDAD</a></li>
    </ul>
  </div>
  <div >
    <p>copyright &copy; <a href="#">KURT BURGERS</a> </p>
  </div>
</footer>

CodePudding user response:

I copied your code and removed the width:100% from .footer-bottom the horizontal scroll disappeared.

  • Related