Use z-index and top . This will fold the div at the bottom, the image and then the top layer (overlay). To set positioning from the top edge, use top , which can be used with negative numbers if you need it to be higher on the y axis than its parent. In the example below, the 10px range moves over the top of its parent div.
<div style="position: relative; z-index: 1;"> <img src="image.png" style="position: absolute; z-index: 2;" /> <span id="overlay_text" style="position: relative; top: -10px; z-index: 3;">OVERLAY</span> </div>
Joe conlin
source share