title: Making dropdown width adjust to its content
body: <p>I have the following CSS and HTML:</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>.dropbtn {
    background-color: #4CAF50;
    color: white;
    padding: 16px;
    font-size: 16px;
    border: none;
    cursor: pointer;
  }
  
  .dropdown {
    position: relative;
    display: inline-block;
  }
  
  .dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: #f9f9f9;
    box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
    z-index: 1;
  }
  
  .dropdown-content a {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: inline-block;
    width: auto;
  }
  
  .dropdown-content a:hover {
    background-color: #f1f1f1
  }
  
  .dropdown:hover .dropdown-content {
    display: inline-block;
  }
  
  .dropdown:hover .dropbtn {
    background-color: #3e8e41;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;body&gt;
    &lt;div class="dropdown" style="float:left;"&gt;
      &lt;button class="dropbtn"&gt;Left&lt;/button&gt;
      &lt;div class="dropdown-content" style="left:0;"&gt;
        &lt;a href="#"&gt;Make this phrase appear on one line.&lt;/a&gt;
        &lt;a href="#"&gt;Link 2&lt;/a&gt;
        &lt;a href="#"&gt;Link 3&lt;/a&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  
  &lt;/body&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I want all the menu items in the dropdown list appear on line - no matter how long they are. Folks say <code>display: inline-block</code> makes this happen. And still no success. Could you please give a hint ?</p>