title: Bootstrap Modal width not adjusting to fit contents
body: <p>After implementing a Modal dialog, I noticed it stretches very wide to wide to fit the screen but I only want it to be as wide as the contents inside it. I don't understand why this is happening when I used <code>width: auto;</code></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-js lang-js prettyprint-override"><code>var modalItems = document.getElementById('itemsModal');
  
  var btnItems = document.getElementById("btn_items");
  
  var btnCloseModalItems = document.getElementById("btn_closeItemsModal");
  
  btnItems.onclick = function() {
    modalItems.style.display = "block";
  }
  
  btnCloseModalItems.onclick = function() {
    modalItems.style.display = "none";
  }</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>#btn_closeItemsModal {
    float: right;
  }
  
  .modal {
    display: none;
    position: fixed;
    z-index: 1;
    padding-top: 100px;
    left: 0;
    top: 0;
    overflow: auto;
    background-color: rgb(0, 0, 0);
    background-color: rgba(0, 0, 0, 0.8);
  }
  
  .close {
    color: white;
    background-color: white;
  }
  
  
  /* Modal Content */
  
  .modal-content {
    position: relative;
    color: black;
    background-color: #fefefe;
    margin: auto;
    padding: 0;
    border: 1px solid #888;
    width: auto;
  }
  
  .modal-header {
    background-color: #0099cc;
    color: white;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" /&gt;
  &lt;div id="itemsModal" class="modal"&gt;
    &lt;div class="modal-content"&gt;
      &lt;div class="modal-header"&gt;
        &lt;button type="button" class="btn btn-default btn-lg" id="btn_closeItemsModal"&gt;&lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt;&lt;/button&gt;
        &lt;h3&gt;Items&lt;/h3&gt;
      &lt;/div&gt;
      &lt;div class="modal-body"&gt;
        &lt;div class="list-group"&gt;
          &lt;a href="#" class="list-group-item list-group-item-action"&gt;Africa&lt;/a&gt;
          &lt;a href="#" class="list-group-item list-group-item-action"&gt;Antarctica&lt;/a&gt;
          &lt;a href="#" class="list-group-item list-group-item-action"&gt;Asia&lt;/a&gt;
          &lt;a href="#" class="list-group-item list-group-item-action"&gt;Eurpoe&lt;/a&gt;
          &lt;a href="#" class="list-group-item list-group-item-action"&gt;North America&lt;/a&gt;
          &lt;a href="#" class="list-group-item list-group-item-action"&gt;Oceania&lt;/a&gt;
          &lt;a href="#" class="list-group-item list-group-item-action"&gt;South America&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  
  
  &lt;button class="btn-lg btn-primary" id="btn_items"&gt;My Items&lt;/button&gt;</code></pre>
  </div>
  </div>
  </p>