Horizontal scroll using nowrap and inline-block
<p>I'm developing a horizontal scrolling gallery using <code>white-space: nowrap</code> and  <code>display: inline-block</code>. A gallery is composed of a series of image panes and a text pane at the end inside a container. You can look at an example here:</p>

<p><a href="https://jsfiddle.net/zcf0va58/3/" rel="nofollow">https://jsfiddle.net/zcf0va58/3/</a></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>.container {
  display: inline-block;
  white-space: nowrap;
  border: 1px solid red;
}
.post-image {
  display: inline-block;
  vertical-align: top;
}
.post-text {
  display: inline-block;
  vertical-align: top;
  max-width: 100px;
  width: 100%;
  white-space: normal;
}</code></pre>
<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="container"&gt;
  &lt;div class="post-image"&gt;
    &lt;img src="http://uc48.net/europeana/images/fpo_square.png" width="100" height="100" /&gt;
  &lt;/div&gt;
  &lt;div class="post-image"&gt;
    &lt;img src="http://uc48.net/europeana/images/fpo_square.png" width="100" height="100" /&gt;
  &lt;/div&gt;
  &lt;div class="post-image"&gt;
    &lt;img src="http://uc48.net/europeana/images/fpo_square.png" width="100" height="100" /&gt;
  &lt;/div&gt;
  &lt;div class="post-image"&gt;
    &lt;img src="http://uc48.net/europeana/images/fpo_square.png" width="100" height="100" /&gt;
  &lt;/div&gt;
  &lt;div class="post-image"&gt;
    &lt;img src="http://uc48.net/europeana/images/fpo_square.png" width="100" height="100" /&gt;
  &lt;/div&gt;
  &lt;div class="post-image"&gt;
    &lt;img src="http://uc48.net/europeana/images/fpo_square.png" width="100" height="100" /&gt;
  &lt;/div&gt;
  &lt;div class="post-image"&gt;
    &lt;img src="http://uc48.net/europeana/images/fpo_square.png" width="100" height="100" /&gt;
  &lt;/div&gt;
  &lt;div class="post-image"&gt;
    &lt;img src="http://uc48.net/europeana/images/fpo_square.png" width="100" height="100" /&gt;
  &lt;/div&gt;
  &lt;div class="post-image"&gt;
    &lt;img src="http://uc48.net/europeana/images/fpo_square.png" width="100" height="100" /&gt;
  &lt;/div&gt;
  &lt;div class="post-image"&gt;
    &lt;img src="http://uc48.net/europeana/images/fpo_square.png" width="100" height="100" /&gt;
  &lt;/div&gt;
  &lt;div class="post-image"&gt;
    &lt;img src="http://uc48.net/europeana/images/fpo_square.png" width="100" height="100" /&gt;
  &lt;/div&gt;
  &lt;div class="post-text"&gt;
    &lt;div&gt;
      some text some text some text some text some text some text some text
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;</code></pre>
</div>
</div>
</p>

<p>As you can see the text pane has a max-width, not a fixed width. This causes the container to shrink a bit. If a specify a fixed width in the text pane the container wraps around the child panes correctly:</p>

<p><a href="https://jsfiddle.net/zcf0va58/4/" rel="nofollow">https://jsfiddle.net/zcf0va58/4/</a></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>.container {
  display: inline-block;
  white-space: nowrap;
  border: 1px solid red;
}
.post-image {
  display: inline-block;
  vertical-align: top;
}
.post-text {
  display: inline-block;
  vertical-align: top;
  width: 100px;
  white-space: normal;
}</code></pre>
<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="container"&gt;
  &lt;div class="post-image"&gt;
    &lt;img src="http://uc48.net/europeana/images/fpo_square.png" width="100" height="100" /&gt;
  &lt;/div&gt;
  &lt;div class="post-image"&gt;
    &lt;img src="http://uc48.net/europeana/images/fpo_square.png" width="100" height="100" /&gt;
  &lt;/div&gt;
  &lt;div class="post-image"&gt;
    &lt;img src="http://uc48.net/europeana/images/fpo_square.png" width="100" height="100" /&gt;
  &lt;/div&gt;
  &lt;div class="post-image"&gt;
    &lt;img src="http://uc48.net/europeana/images/fpo_square.png" width="100" height="100" /&gt;
  &lt;/div&gt;
  &lt;div class="post-image"&gt;
    &lt;img src="http://uc48.net/europeana/images/fpo_square.png" width="100" height="100" /&gt;
  &lt;/div&gt;
  &lt;div class="post-image"&gt;
    &lt;img src="http://uc48.net/europeana/images/fpo_square.png" width="100" height="100" /&gt;
  &lt;/div&gt;
  &lt;div class="post-image"&gt;
    &lt;img src="http://uc48.net/europeana/images/fpo_square.png" width="100" height="100" /&gt;
  &lt;/div&gt;
  &lt;div class="post-image"&gt;
    &lt;img src="http://uc48.net/europeana/images/fpo_square.png" width="100" height="100" /&gt;
  &lt;/div&gt;
  &lt;div class="post-image"&gt;
    &lt;img src="http://uc48.net/europeana/images/fpo_square.png" width="100" height="100" /&gt;
  &lt;/div&gt;
  &lt;div class="post-image"&gt;
    &lt;img src="http://uc48.net/europeana/images/fpo_square.png" width="100" height="100" /&gt;
  &lt;/div&gt;
  &lt;div class="post-image"&gt;
    &lt;img src="http://uc48.net/europeana/images/fpo_square.png" width="100" height="100" /&gt;
  &lt;/div&gt;
  &lt;div class="post-text"&gt;
    &lt;div&gt;
      some text some text some text some text some text some text some text
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;</code></pre>
</div>
</div>
</p>

<p>Is this the expected behaviour? Is there a way to get the container to wrap around the child panes correctly without having to specify a fixed width in the text pane?</p>