Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

143
Vistas
how to make smooth scroll?

I'm using bootstrap and this is my code. how to make smooth scroll ? Please help me

<div id="navbar-normal" class="navbar navbar-expand-lg">
        <div class="container">
            <a href="" class="navbar-brand">
                <img src="assets/images/logo.svg" alt="">
            </a>
            <div class="collapse navbar-collapse">
                <ul class="navbar-nav">
                    <li class="nav-item"><a href="#home" class="nav-link">Home</a></li>
                    <li class="nav-item"><a href="#about" class="nav-link">About</a></li>
                    <li class="nav-item"><a href="#news" class="nav-link">News</a></li>
                    <li class="nav-item"><a href="#contact" class="nav-link">Contact</a></li>
                </ul>
            </div>
        </div>
    </div>

<section id="home"><h1>Home</h1></section>
    <section id="about"><h1>About</h1></section>
    <section id="news"><h1>News</h1></section>
    <section id="contact"><h1>Contact</h1></section>
about 4 years ago · Juan Pablo Isaza
3 Respuestas
Responde la pregunta

0

You don't need to use javascript to add smooth scrolling, it can be done by setting scroll-behavior: smooth; css property. Example:

html {
  scroll-behavior: smooth;
}

However that is not supported by all browsers See caniuse.com

By using a library like scroll-js, you can get scrolling working on browsers like safari.

about 4 years ago · Juan Pablo Isaza Denunciar

0

It's not obvious what you mean. If you mean that you want the page to smoothly go from one anchor link to the next, use CSS scroll-behavior. If you want elements on the page to move smoothly as the user scrolls with their finger or mouse wheel, I would suggest Locomotive Scroll or similar. However, you're probably looking for the first option.

CSS scroll-behavior demo:

:root {
  scroll-behavior: smooth;
}

/* demo */
nav {
  display: block;
  height: 1rem;
  position: fixed;
}
section { 
  height: 100vh; 
  padding-top: 2rem;
}
<nav>
  <a href="#a">Go to A</a>
  <a href="#b">Go to B</a>
  <a href="#c">Go to C</a>
</nav>

<section id="a">Section A</section>
<section id="b">Section B</section>
<section id="c">Section C</section>

about 4 years ago · Juan Pablo Isaza Denunciar

0

You don't need to use javascript to add smooth scrolling

in css use this

:root{
  behavior: smooth;
}
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda