Home » Html » Bootstrap : how to disable vertical scrollbar?

Bootstrap : how to disable vertical scrollbar?

Posted by: admin December 31, 2017 Leave a comment

Questions:

when my modal popup window opens, it adds a vertical scrollbar to the right of the browser window. How do i disable this? I think this is enabled when the modal window has a very large height value where it needs to scroll. i want to disable this as my form height does not exceed the window height.

Answers:

In your css add :

body {
  overflow-y:hidden;
}

Questions:
Answers:

I have the same problem with bootstrap 3.0.0. It seems that .modal class has overflow-y: scroll rule which results in scrollbar always visible.

So, you can amend this either locally:

<div class="modal" ... style="overflow-y: auto;">
    ...
</div>

or globally:

<style>
.modal {
    overflow-y: auto;
}
</style>

Questions:
Answers:

If the model window height is not more than normal window height, it doesn’t make any sense to display the the scroll bar. Check weather any <div></div> used to fade the background behind the model window has extra height than the viewpoint.

Questions:
Answers:

Add style to body as:

body { 
  padding-right: 0px !important;
  overflow-y: hidden !important;
}