Set Bootstrap modal content to scroll if height exceeds browser
<p>I have seen so many people asking about this, but no real solid reliable answer.</p>

<p>If the height of the modal exceeds the browser's inner height, I want the red-bordered Div to have a scroll bar to keep the modal within the browser view.</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-css lang-css prettyprint-override"><code>#scrollbox {
  border: 1px solid red;
  }</code></pre>
<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
&lt;link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"&gt;
&lt;script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"&gt;&lt;/script&gt;

&lt;input type="button" data-toggle="modal" data-target="#myModal" value="Launch Modal"&gt;

&lt;div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"&gt;
  &lt;div class="modal-dialog" role="document"&gt;
    &lt;div class="modal-content"&gt;
      &lt;div class="modal-body"&gt;
        Hello, below is some text in a div that should start scrolling if the height of the modal exceeds the browser.
        
        &lt;p&gt;&lt;div id="scrollbox"&gt;
          the&lt;br&gt;quick&lt;br&gt;brown&lt;br&gt;fox&lt;br&gt;
          the&lt;br&gt;quick&lt;br&gt;brown&lt;br&gt;fox&lt;br&gt;
          the&lt;br&gt;quick&lt;br&gt;brown&lt;br&gt;fox&lt;br&gt;
          the&lt;br&gt;quick&lt;br&gt;brown&lt;br&gt;fox&lt;br&gt;
          the&lt;br&gt;quick&lt;br&gt;brown&lt;br&gt;fox&lt;br&gt;
          the&lt;br&gt;quick&lt;br&gt;brown&lt;br&gt;fox&lt;br&gt;
          the&lt;br&gt;quick&lt;br&gt;brown&lt;br&gt;fox&lt;br&gt;
          the&lt;br&gt;quick&lt;br&gt;brown&lt;br&gt;fox&lt;br&gt;
          the&lt;br&gt;quick&lt;br&gt;brown&lt;br&gt;fox&lt;br&gt;
          the&lt;br&gt;quick&lt;br&gt;brown&lt;br&gt;fox&lt;br&gt;
        &lt;/div&gt;
        
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;</code></pre>
</div>
</div>
</p>