1

Bootstrap, keep div fixed after scrolling to it

I found the way to fix the position but my content is too much and overflowed How to make the content scrollable in the fixed position?

chewyx
  • 11
  • 4

1 Answers1

0

You can just set a maximum height <= 100vh to keep the entire element within view. Then set overflow to scroll or auto. Auto adds scrollbars only when necessary.

max-height: 90vh;
overflow: auto;

See my fiddle

Arleigh Hix
  • 9,990
  • 1
  • 14
  • 31