title: How to stretch container width based on label text length?
body: <p>I am trying to implement a custom button with label and icon.<br>
  The problem is, if the label text is too long, it will overflow.<br>
  My goal is to make the button responsive, based on the label text width, using CSS.</p>
  
  <p>This is what I managed to get so far:  <a href="https://jsfiddle.net/tymudy/5kwme2Ls/" rel="nofollow noreferrer"><strong>jsFiddle</strong></a></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>.btn_container{
      position: relative;
      background-color: green;
      height: 40px;
      width: 100px;
  }
  
  .btn_label{
      position: relative;
      background-color: red;
      width: 70%;
      height: 100%;
      float:left;
  }
  
  .btn_icon{
      position: relative;
      background-color: blue;
      width: 30%;
      height: 100%;
      float: right;
  }
  
  label{
      position: absolute;
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%);
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;link href="http://netdna.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css" rel="stylesheet"/&gt;
  &lt;div class="btn_container"&gt;
    &lt;div class="btn_label"&gt;
      &lt;label&gt;Text i want to fit in the div...&lt;/label&gt;
    &lt;/div&gt;
    &lt;div class="btn_icon"&gt;
      &lt;i class="fa fa-plus"&gt;&lt;/i&gt;
    &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>The problem is, if the label text overflows, "btn_label" and "btn_container" width should be stretched according to the label text width.</p>
  
  <p>How can I accomplish that?</p>