 <p>To position something absolutely (which is what you want to do), it has to have container that also has positioning set to position itself against. Sounds complex, but it's not really.</p> <p>If you set your container to position:relative (meaning keep it in the flow of the document where it would normally be), then you can set descendant elements to position: absolute. </p> <p>So, in your case, if you wrap your image and button in a div and set the div to position: relative, you can set the button to position: absolute like this:</p> <pre><code>&lt;div style="position: relative;"&gt; &lt;img src="yourimagename.jpg" alt=""&gt; &lt;button style="position: absolute; top: 0; right: 0; z-index: 1;"&gt;&amp;times&lt;/button&gt; &lt;/div </code></pre>