user3093095
user3093095

Reputation: 71

Bootstrap Modal showing scroll bar where not needed

http://puu.sh/5L7XV.png

You can see the modal and the scroll bar on right.

I'm using the code directly from their docs - http://getbootstrap.com/javascript/#modals

See the picture.

It's adding an unnecessary scroll bar.

How can I get rid of this?

Code:

<!-- Button trigger modal -->
<button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">
  Launch demo modal
</button>

<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title" id="myModalLabel">Modal title</h4>
      </div>
      <div class="modal-body">
        ...
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        <button type="button" class="btn btn-primary">Save changes</button>
      </div>
    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
</div><!-- /.modal -->

Thanks.

Upvotes: 0

Views: 976

Answers (1)

Fex del Sollo
Fex del Sollo

Reputation: 386

To hide the scrollbar add this to your own stylesheet:

#myModal {
    overflow: hidden;
}

Please keep in mind that if a you got a lot of content within the modal the user won't be able to scroll!

Upvotes: 1

Related Questions