I am trying to achieve a layout where an image is displayed behind an H1 tag, with the width of the image matching the width of the text.
Here is my code:
<div style="display: inline;">
<img src="http://img585.imageshack.us/img585/3989/m744.png" width="100%" height="68" />
<h1 style="position: absolute; top: 0px;">Variable length text</h1>
</div>
Link to JSFiddle example: http://jsfiddle.net/Aykng/
Current Look:
Desired Look:
I am looking for a solution where the image width adjusts to fill the div. How can I make this work while ensuring compatibility with IE 7+? Using background-image and background-size would be easier, but I need it to work on older versions of Internet Explorer.