I'm trying to fit a lot of text into a modal box created using Twitter Bootstrap but I'm having a problem: the content refuses to scroll. I tried adding overflow:scroll
and overflow-y:scroll
but to no avail; that merely causes it to display a scroll-bar without actually enabling scrolling.
What's the cause behind that and what can I do?
I was able to overcome this by using the "vh" metric with max-height on the .modal-body element. 70vh looked about right for my uses.
This is how I did it purely with CSS overriding some classes:
Hope it helps you.
it's works for me
After using all these mentioned solution, i was still not able to scroll using mouse scroll, keyboard up/down button were working for scrolling content.
So i have added below css fixes to make it working
Added pointer-events: auto; to make it mouse scrollable.
I'm having this issue on Mobile Safari on my iPhone6
Bootstrap adds the class
.modal-open
to the body when a modal is opened.I've tried to make minimal overrides to Bootstrap 3.2.0, and came up with the following:
For comparison, I've included the associated Bootstrap styles below.
Selected extract from bootstrap/less/modals.less (don't include this in your fix):
Mobile Safari version used:
User-Agent Mozilla/5.0 (iPhone; CPU iPhone OS 8_1 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12B411 Safari/600.1.4
I had the same issue, and found a fix as below:
100% working.