Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

199
Views
¿Cómo hacemos que la barra lateral sea pegajosa usando css?

Barra lateral Sitcky

Necesito hacer que la columna cre_asideCol sea pegajosa. Pero estoy enfrentando algunos problemas con esto y no puedo crear esta barra lateral pegajosa.

about 4 years ago · Juan Pablo Isaza
3 answers
Answer question

0

Con css debes escribir en la barra lateral:

 position: sticky; top: 0;

Es posible que deba agregar un envoltorio de etiqueta adicional para que funcione el posicionamiento fijo

 .entry-content { width: 400px; height: 400px; background-color: aqua; position: relative; } .sidebar { position: sticky; background-color: red; width: 375px; height: 100%; left: 0; } .menu { position: absolute; right: 0; } .cre-asideCol { position: absolute; left: 0px; background-color: orange; width: 300px; height: 100%; overflow: auto; }
 <div class="entry-content"> <div class="sidebar"> <div class="menu"> <nav>menu 1</nav> <nav>menu 2</nav> <nav>menu 3</nav> <nav>menu 4</nav> <nav>menu 5</nav> </div> <div class="cre-asideCol"> <p> Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. Why do we use it? It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like). </p> </div> </div> </div>

about 4 years ago · Juan Pablo Isaza Report

0

Establecería la position: sticky . Sin embargo, debe prestar atención al atributo de la parte superior, lo que ha configurado, porque eso significará que la barra lateral se mantendrá a partir de ese momento. Entonces, si tiene position:sticky, top:20px, eso se mantendrá después de que el desplazamiento supere los 20px.

about 4 years ago · Juan Pablo Isaza Report

0

Ahora el tema solucionado

 overflow: inherit; align-items: flex-start;

Necesitamos agregar estas propiedades CSS al elemento principal de la barra lateral.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!