faqts : Computers : Internet : Web : HTML

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

24 of 39 people (62%) answered Yes
Recently 9 of 10 people (90%) answered Yes

Entry

How can I display text over an image?
How can I display text over an image?

Nov 29th, 2001 02:04
Tony Hookham, Ben Gordon, Carlos Orozco, Joćo Martins, http://www.w3schools.com


I think that the only way to do that is with CSS or DHTML. Plain html 
won't do that for you.
You can use the CSS property of position: absolute to achieve this you 
would need to place the text in a container like a <p> or a <div> then 
you simply add style="position: absolute; top: ??px; left:??px;" to the 
tag so it would be like <p style="position: absolute; top: ??px; 
left:??px;">Your Text</p> just replace the ?? with the number of pixels 
needed to place the text over the image, you will have to play with it 
to get it right.  Another way would be to use javascript.
In a table you can make the background yourimage.gif, and then put your 
text in the TD