bootstrap 3 modal padding issue solution

The problem is caused by a function in the bootstrap jQuery that adds a bit of padding-right when a modal window opens, if there is a scroll bar on the page. That stops your body content shifting around when the modal opens, and it’s a nice feature. But it’s causing this bug.

A lot of the other solutions given here break that feature, and make your content shift slightly about when the modal opens. This solution will preserve the feature of the bootstrap modal not shifting content around, but fix the bug. This is a pure css solution that keeps the bootstrap functionality as it should be.


Leave a Reply

Generic selectors
Exact matches only
Search in title
Search in content
Search in posts
Search in pages