Bootstrap Modals keep adding padding-right to body after closed

后端 未结 30 1944
南方客
南方客 2020-12-12 12:36

I am using bootstrap and Parse framework to build a small webapp. But those Bootstrap modals keep adding padding-right to body after closed. How to solve this?

I tri

30条回答
  •  感情败类
    2020-12-12 13:11

    I know this is an old question, but none of the answers from here removed the problem in my similar situations and I thought it would be useful for some developers to read my solution too.

    I use to add some CSS to the body when a modal is opened, in the websites where it is still used bootstrap 3.

    body.modal-open{
                padding-right: 0!important;
                overflow-y:scroll;
                position: fixed;
            }
    

提交回复
热议问题