title: Multi-line inline-block element to take remaining width but not more
body: <p>I have fake checkbox to style it according to app style guide.</p>
  <pre><code>&lt;label&gt;
      &lt;input type=&quot;checkbox&quot; /&gt;
      &lt;span class=&quot;fake-checkbox&quot;&gt;&lt;/span&gt;
      &lt;span class=&quot;actual-label&quot;&gt;
          ...
      &lt;/span&gt;
  &lt;/label&gt;
  </code></pre>
  <p>I hide input and style both <code>SPAN</code> as <code>inline-block</code>. This works great as long as checkbox label is narrow enough to fit a single line. The problem becomes apparent when label text is too long to fit a single line in which line it breaks into a new line, keeping checkbox alone in the line.</p>
  <p>If I set <code>label { white-space: nowrap; }</code> and <code>.actual-label { white-space: normal; }</code>, then checkbox and text stay on the same line, actual label text does break into multiple lines, but it has 100% content width instead of less fake checkbox.</p>
  <p>My checkboxes must allow positioning of several in the same line or columns etc... Just like regular checkboxes do. This simply means that floats are ruled out.</p>
  <h3>Flexbox does it</h3>
  <p>I can achieve exactly what I want by using flexbox, but unfortunately I need to support older browsers without flexbox.</p>
  <h2>Question</h2>
  <p>What ways do I have to make multi-line actual label <code>span</code> take all the rest width and break into several lines. Things I can't use:</p>
  <ul>
  <li>flexbox</li>
  <li>floats</li>
  </ul>
  <p>I've created <a href="http://plnkr.co/edit/5uZYTBvLmqFK0Hxt6xBy?p=preview" rel="nofollow noreferrer">a Plnkr example</a> where the same control is shown twice. First in the problematic form and second the way that it should be displayed. Second control is styled using flexbox which I can't use.</p>
  <p><div class="snippet" data-lang="js" data-hide="true" data-console="true" data-babel="false">
  <div class="snippet-code snippet-currently-hidden">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>label {
    display: inline-block;
    outline: 1px solid rgba(0, 0, 0, 0.25);
    white-space: nowrap;
    font-size: 0;
  }
  label * {
    white-space: normal;
    font-size: initial;
  }
  label .fake-checkbox {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 1px solid #ccc;
    border-radius: 2px;
    margin-right: 8px;
    vertical-align: top;
    box-sizing: border-box;
  }
  label .fake-checkbox:before {
    content: "";
    display: inline-block;
  }
  label .actual-label {
    display: inline-block;
    vertical-align: top;
    outline: 1px solid rgba(0, 0, 0, 0.25);
  }
  section {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-content: flex-end;
    align-items: flex-start;
    outline: 1px solid rgba(0, 0, 0, 0.25);
  }
  section .fake-checkbox {
    flex-shrink: 0;
    flex-grow: 0;
    display: block;
    width: 18px;
    height: 18px;
    border: 1px solid #ccc;
    border-radius: 2px;
    margin-right: 8px;
    box-sizing: border-box;
  }
  section .actual-label {
    outline: 1px solid rgba(0, 0, 0, 0.25);
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;label&gt;
    &lt;span class="fake-checkbox"&gt;&lt;/span&gt;
    &lt;span class="actual-label"&gt;
      Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec in nunc porta, congue purus ut, pharetra purus. Donec vitae sem viverra, iaculis ante ac, feugiat massa. Sed vitae ultrices dui, porttitor rutrum metus. Donec feugiat porta nisi, sit amet elementum nunc interdum eu. Curabitur aliquet ipsum molestie, rutrum neque nec, tincidunt odio. Vestibulum eget malesuada lorem. Pellentesque et lobortis augue, vel hendrerit nulla. Sed augue sapien, fringilla sit amet justo id, mollis congue massa. Praesent vitae turpis ac neque tincidunt dignissim. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Curabitur consequat scelerisque nibh ac cursus.
    &lt;/span&gt;
  &lt;/label&gt;
  &lt;br/&gt;
  &lt;br/&gt;
  &lt;section&gt;
    &lt;span class="fake-checkbox"&gt;&lt;/span&gt;
    &lt;span class="actual-label"&gt;
      Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec in nunc porta, congue purus ut, pharetra purus. Donec vitae sem viverra, iaculis ante ac, feugiat massa. Sed vitae ultrices dui, porttitor rutrum metus. Donec feugiat porta nisi, sit amet elementum nunc interdum eu. Curabitur aliquet ipsum molestie, rutrum neque nec, tincidunt odio. Vestibulum eget malesuada lorem. Pellentesque et lobortis augue, vel hendrerit nulla. Sed augue sapien, fringilla sit amet justo id, mollis congue massa. Praesent vitae turpis ac neque tincidunt dignissim. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Curabitur consequat scelerisque nibh ac cursus.
    &lt;/span&gt;
  &lt;/section&gt;</code></pre>
  </div>
  </div>
  </p>