title: Text overlays over image using relative positioning
body: <p>I want to position a text overlaying an image. Below is my currently used code:</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-html lang-html prettyprint-override"><code>&lt;td width="10%"&gt;
    &lt;img src="tempballoon.png" alt="balloon" style="z-index: -1" /&gt;
    &lt;div style="position:relative;left:30px;top:-75px;font-size: 32px;display: none"&gt;
      Test
    &lt;/div&gt;
  &lt;/td&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>My problem is, although the text is properly overlayed, the "space" it consumes in the <code>&lt;td&gt;</code> is still there! When I tried to replace the 'top' position in the <code>&lt;div&gt;</code> with 'margin-top', it also affects the <code>&lt;img&gt;</code> and so the <code>&lt;img&gt;</code> goes past the border of the <code>&lt;td&gt;</code>.</p>