How can I make multiple on scroll fixed headers/navbars that stick at the very top of the page?

后端 未结 3 1427
遇见更好的自我
遇见更好的自我 2021-01-05 21:25

Does anyone know how to make multiple on scroll fixed headers? I\'ve checked answers such as this.

It\'s kind of what I want, but I want that header to stop before a

3条回答
  •  悲&欢浪女
    2021-01-05 21:58

    Demo:

    http://jsfiddle.net/4tmcLjq3/3/

    Explanation:

    position: sticky with correct markup will do the work

    PS: I know there is already an answer using position: sticky but in that solution the previous header doesn't stop but overlaps with the next one. In my solution is stops before the next sticking.

提交回复
热议问题