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!

Text over image

Status
Not open for further replies.

Craftor

Programmer
Feb 1, 2001
420
NZ
Hi all

I want to have an image on my web page that can have text over it. Creating an image with embedded text is unfortunately not an option as the text is likely to change on a weekly, if not daily option.

I've been playing around with using a table and the background image property and that almost works well - except for one or two little probs ... I want to be able to resize the image myself - and the image tiles itself if it is smaller than the table cell.

I think this kind of thing can maybe be done with a DIV / LAYER? I tried that too but it didn't show up on the web page at all :-(

Can anyone please help me with this?

Apologies if this question has already been addressed - the search is still down :-(

Thanks as always

Craftor

:cool:
 
Try this kind of code :
CSS File
Code:
.ImageAndText {
	border : none 0px #000000;
	position : absolute;
	top : 5px;
	left : 5px;
	width : 100px;
	height : 100px;
	overflow : hidden;
	display : block;
	text-align : center;
}

HTML File
Code:
<IMG Class=&quot;ImageAndText&quot; src=&quot;myImage.gif&quot; style=&quot;z-index : -1;&quot;/>
<DIV Class=&quot;ImageAndText&quot; style=&quot;z-index : 1;&quot;>This text should appear over image</DIV>
Water is not bad as long as it stays out human body ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top