Holiday Notice: Support will be provided on a limited scale from December 24th, 2024, to January 2nd, 2025. Happy holidays and a wonderful New Year!


Topic: Remove the padding right modal on navigation

Neanrakyr pro asked 6 years ago


Hello, today I install the modal button in my navigation. When I click on the icon I see a style who appared on my body: style="padding-right: 17px;" I would like to know how to remove it, because each time i click on the button all my menu move. Thank you

Manuel Remus Stanca free commented 6 years ago

put 0 iof 17px

Hasan Ali Haolader free answered 2 years ago


Add in JS

modal.on('show.bs.modal', function () {
    $('body').addClass('modal-padding-overlap');
});

Add in CSS

.modal-padding-overlap[style] {
    padding-right:0 !important;
    padding-left: 0 !important;
}

mustufaahmed375 free answered 5 years ago


Also, try this, body { padding-right: 0 !important }its literally solve my problem


LauraPitskhelauri pro answered 6 years ago


Hi, I had same problem, i found solution by removing class .fade https://stackoverflow.com/questions/32862394/bootstrap-modals-keep-adding-padding-right-to-body-after-closed

Marta Wierzbicka staff commented 6 years ago

OK, great.

Marta Wierzbicka staff answered 6 years ago


Hi Neanrakyr, is the Manuel Remus Stanca's answer fine for you? Best, Marta

Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Pro
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No
Tags