0

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.

Dremet
  • 1,008
  • 1
  • 9
  • 23
  • This question has already been answered: http://stackoverflow.com/questions/3296644/hiding-the-scrollbar-on-an-html-page#answer-25561646 – iomv Jun 16 '16 at 22:16

1 Answers1

1

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.

Raptack
  • 371
  • 1
  • 3
  • 5
  • Perfect, that was what I was looking for. Now I just need to figure out how to fill the space below the navbar with the navbar background color. – Dremet Jun 17 '16 at 20:04
  • You should remove `position: static` from #menu when the menu div have the active class. – Raptack Jun 17 '16 at 23:35