title: bootstrap modal dialog appearing at side of page
body: <p>I have a modal dialog that appears when i click on a thumbnail. I have a js (grabbed from an online source) with a basic bootstrap grid layout.</p>
  
  <p>The problem is that 50% of the popup seems to hang off the edge of the page. It seems to work hen i reduce the width of the page. </p>
  
  <p>My code is as follows (nb; you dont need the js to see this)</p>
  
  <pre><code>&lt;!doctype html&gt;
  &lt;html class="no-js" lang=""&gt;
      &lt;head&gt;
          &lt;meta charset="utf-8"&gt;
          &lt;meta http-equiv="x-ua-compatible" content="ie=edge, chrome=1"&gt;
          &lt;title&gt;site name&lt;/title&gt;
          &lt;meta name="description" content=""&gt;
          &lt;meta name="viewport" content="width=device-width"&gt;
  
          &lt;link rel="logo" href="img/logo.png"&gt;
          &lt;!-- Place favicon.ico in the root directory --&gt;
          &lt;link rel="stylesheet" href="css/bootstrap.css"&gt;
          &lt;link rel="stylesheet" href="css/main.css"&gt;
  
          &lt;link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css"&gt;
  
          &lt;script src="js/vendor/modernizr-2.8.3.min.js"&gt;&lt;/script&gt;
          &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"&gt;&lt;/script&gt;
          &lt;script src="js/bootstrap.min.js"&gt;&lt;/script&gt;
          &lt;script src="js/main.js"&gt;&lt;/script&gt;
      &lt;/head&gt;
  &lt;body&gt;
  
  &lt;div class="container"&gt;
      &lt;div class="row"&gt;
          &lt;div class="col-lg-4"&gt;
               &lt;h1 class="page-header"&gt;Thumbnail Gallery&lt;/h1&gt;
  
              &lt;div class="col-lg-3 col-md-4 col-xs-6 thumb"&gt; &lt;a class="thumbnail" href="#" data-image-id="" data-toggle="modal" data-title="This is my title" data-caption="Some lovely red flowers" data-image="http://www.picturesnew.com/media/images/car-image.jpg" data-target="#image-gallery"&gt;
                      &lt;img class="img-responsive" src="http://www.picturesnew.com/media/images/car-image.jpg" alt="Short alt text" /&gt;
                  &lt;/a&gt;
  
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="modal fade" id="image-gallery" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"&gt;
      &lt;div class="modal-dialog"&gt;
          &lt;div class="modal-content"&gt;
              &lt;div class="modal-header"&gt;
                  &lt;button type="button" class="close" data-dismiss="modal"&gt;&lt;span aria-hidden="true"&gt;×&lt;/span&gt;&lt;span class="sr-only"&gt;Close&lt;/span&gt;
  
                  &lt;/button&gt;
                   &lt;h4 class="modal-title" id="image-gallery-title"&gt;&lt;/h4&gt;
  
              &lt;/div&gt;
              &lt;div class="modal-body"&gt;
                  &lt;img id="image-gallery-image" class="img-responsive" src="" /&gt;
              &lt;/div&gt;
              &lt;div class="modal-footer"&gt;
                  &lt;div class="col-md-2"&gt;
                      &lt;button type="button" class="btn btn-primary" id="show-previous-image"&gt;Previous&lt;/button&gt;
                  &lt;/div&gt;
                  &lt;div class="col-md-8 text-justify" id="image-gallery-caption"&gt;This text will be overwritten by jQuery&lt;/div&gt;
                  &lt;div class="col-md-2"&gt;
                      &lt;button type="button" id="show-next-image" class="btn btn-default"&gt;Next&lt;/button&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/kwKci.png" alt="enter image description here"></p>