How to vertically center text next to absolute container? : <p>I'd like to vertically center this text next to the image to get a result like this: <a href="https://i.stack.imgur.com/pxqXZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pxqXZ.png" alt="img"></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>.container {
  position: absolute; 
  width: 50%;
}

.span {
  vertical-align:middle;
  display: inline;
}</code></pre>
<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;p&gt;
    &lt;div class="container"&gt;
      &lt;img style="width: 100%" src="http://placehold.it/150x50"/&gt;
      &lt;span class="span"&gt;should be vertically centered next to image&lt;/span&gt;
    &lt;/div&gt;
&lt;/p&gt;</code></pre>
</div>
</div>
</p>

<p><strong>How to edit my code to center this text next to the ABSOLUTE container?</strong></p>

<p>Any help would be very appreciated. Thanks.</p>
