Regresar a la página www.ComoCrearTuWeb.com
Resultados 1 al 2 de 2

Tema: Trouble implementing sticky navbar

  1. #1
    Recien Llegado! Pasaba por aquí...
    Fecha de Ingreso
    14 ago, 19
    Mensajes
    1
    Poder de Reputación
    0

    Trouble implementing sticky navbar

    I'm trying to make a website with a navbar that sticks to the top of the screen. I followed the tutorial on w3schools, and while most of it works, it seems like the selector for finding the next element after the sticky class isn't working.

    I don't know if it has to do with precedence, or if I wrote something wrong and it's just not finding anything, or what, but I've messed around with every parameter I could think of and commented out all the other styling for the affected items and nothing is working.

    Even making a selector like ".sticky ~ *" does nothing. It's like once the sticky class is applied, it stops looking for other rules that might be affected by it. Moving the rules to the bottom, adding !important, nothing seems to work.https://192168ll.onl/ https://xender.vip/ https://testmyspeed.onl/


    If someone better at CSS than me could figure out why it's not working, I'd appreciate it. I've been stuck on this for over an hour and I'm going nowhere. I hope the code is relatively easy to read.
    Última edición por takit5; 18/08/2019 a las 19:53

  2. #2
    Recien Llegado! Merodeador
    Fecha de Ingreso
    21 ago, 19
    Mensajes
    4
    Poder de Reputación
    0
    Cita Iniciado por takit5 Ver Mensaje
    I'm trying to make a website with a navbar that sticks to the top of the screen. I followed the tutorial on w3schools, and while most of it works, it seems like the selector for finding the next element after the sticky class isn't working.

    I don't know if it has to do with precedence, or if I wrote something wrong and it's just not finding anything, or what, but I've messed around with every parameter I could think of and commented out all the other styling for the affected items and nothing is working.

    Even making a selector like ".sticky ~ *" does nothing. It's like once the sticky class is applied, it stops looking for other rules that might be affected by it. Moving the rules to the bottom, adding !important, nothing seems to work. https://19216811-login.info


    If someone better at CSS than me could figure out why it's not working, I'd appreciate it. I've been stuck on this for over an hour and I'm going nowhere. I hope the code is relatively easy to read.
    I might be misunderstanding, but I just added "position: sticky;" to your <nav> element in the CSS and it seems to work?

Temas Similares

  1. Insertar navbar de fireworks
    Por esllarc en el foro Otros Elementos
    Respuestas: 1
    Último Mensaje: 10/12/2011, 16:14
  2. navbar con menu desplegable
    Por dhanict en el foro Dreamweaver
    Respuestas: 0
    Último Mensaje: 05/07/2011, 21:20

Permisos de Publicación

  • No puedes crear nuevos temas
  • No puedes responder temas
  • No puedes subir archivos adjuntos
  • No puedes editar tus mensajes
  •