Displaying Text Over an Image

kimkils

Power Member
Jan 10, 2009
667
231
I've been trying to get this to work for ages, i want an image, and then be able to have text wherever i want over it... BUT it has to stay in the same position if the window is re-sized or if different screen resolutions are used.

I know it's to do with DIV's, but i cant quite get my head around it, any takers? I've checked out links on the tinterwebz but they dont maintain the placement when the window resizes.

Salrite, figured it out, wasnt hard *slaps face* http://css-tricks.com/text-blocks-over-image/
 
Last edited:
you need to use a higher z-index for the div that holds the text, then use positive absolute, you may need a div around the image and the text.
 
you need to use a higher z-index for the div that holds the text, then use positive absolute, you may need a div around the image and the text.

Z-index works only for images ,so if you want to overlap one image over the other ,that's when you use the z-index and not in this case.
 
There are two ways to do it, either use watermarking or you can keep image in the background and keep text over the image
 
Z-index works only for images ,so if you want to overlap one image over the other ,that's when you use the z-index and not in this case.

Z-index is not only for images. It works on all positioned elements. I use it quite often for tooltips and fly out menus.
 
Back
Top
AdBlock Detected

We get it, advertisements are annoying!

Sure, ad-blocking software does a great job at blocking ads, but it also blocks useful features and essential functions on BlackHatWorld and other forums. These functions are unrelated to ads, such as internal links and images. For the best site experience please disable your AdBlocker.

I've Disabled AdBlock