tags:

views:

52

answers:

2

Hello StackOverflow,

I'm currently developing a simple page.

Does anyone know of any way to overlay a texture image over text? It seems like it's not possible with the current spec, but please let me know if this is possible.

Thanks and take care!

+1  A: 

Not with pure CSS alone, and certainly not in a cross browser compatible way. Best to just make it a transparent .png image.

Andrew
Thanks - one can hope for a day where browsers play nicely together! 'Til then, take care.
John Calvin
+3  A: 

You can't overlay an image over text with native CSS 2.1, That will not be implemented into CSS 3.0 either. The best practice is to use a background image and still use your text in the <h1> tag and hide it with CSS.

<style>
h1 { background:url(images/imagepath.png) no-repeat; height:50px; width:300px; text-indent:-10000px; }
</style>

<body>
   <h1>Insert Text Here</h1>
</body>
Jon Harding
This was what I was thinking too. Thanks for taking the effort to type out the html as well.
John Calvin