Stretchable/expandable vertically aligned text (relative to image) <p>I would like to place some text next to an image where the text is vertically aligned relative to the image. However, I do not know how wide the window will be and so I would like the text container to expand to fill the available space.</p> <p>I have tried simply putting vertical-align:middle on the text container. That kind of works, but the text will wrap below the image if the text is too long. In order to combat this, I used display:inline-block on the text container. However, this then puts the whole text container below the image!</p> <p>So far, I have something like this:</p> <pre><code>&lt;span&gt;&lt;img src="img.gif" /&gt;&lt;/span&gt; &lt;span style="display:inline-block; vertical-align:middle"&gt;Text goes here&lt;/span&gt; </code></pre>