Search code examples
htmlcssresponsive-designnavbaryui-pure-css

How do I remove the scrollbar of the purecss navbar?


On my website I use pure.css and the navbar consists of more elements than a small screen can display without scrolling. Therefore a scrollbar appears in that case, which I don't want. I would like the navbar to stay at the top so that the navbar and the content scrolls simultaneously. When I use position:absolute; everything looks even worse. Also the mobile version of that navbar should still work (on mobile screens scrolling though the navbar should still be possible).

I also tried to deactivate overflow-y, but then, obviously, not every element on the navbar is clickable.


Solution

  • If you want that navbar and content scroll simultaneously, you shouldn't use position:fixed.

    • Remove position:fixed
    • Add float:left to menu div
    • Add float:right to content div

    If I misunderstood what you want, the comment made by Marco Valente should be nice.