Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Place text on top of an image

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I was just wondering how a person goes about placing text on top of an image. When the text has to go at specifuc spots on the image
 
you could make the image the background of a table ie:

<table width=65 height=80 cellpadding=0 cellspacing=0>
<tR>
<td background=&quot;someimage.jpg&quot; valign=top align=left>
<span style=&quot;padding-top:20px; padding-left:30px&quot;>text over</span>
</td>
</tr></table>

where the height and width of your table are the height and width of your image and padding-top and padding-left are the top and left postion of your text relative to the top left of the image
 
This goes in the head:

<STYLE>
<!--
#pic
{
position : absolute;
top : 300px;
left : 40px;
z-index; 0;
}
.words
{
position : absolute;
top: 300px;
left: 40px;
z-index: 1;
}
//-->
</STYLE>

This goes in the body:

<Div id=&quot;pic&quot;>
<IMG SRC=&quot;logo.gif&quot;>
</Div>
<Div class=&quot;words&quot;>
TESTING
</Div>
</BODY>


I'm sure someone will post a better way than me but this might work for you.
 
mithrilhall's way is fine, but if you only do it once or twice, it might be easier to do simply this:

<img width=&quot;400&quot; height=&quot;200&quot; src=&quot;image.gif&quot;><br>
<span style=&quot;position:relative;bottom:200;&quot;>this text can be moved!!!</span> It's a pleasure to know that I've helped you. If I have,
please click the link below to let me know. :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top