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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Dynamic Text as background in TD

Status
Not open for further replies.

tektipsismyfavorite

Technical User
May 4, 2006
57
US
I want to put the year in the background of a table cell using either a dynamic gif or CSS. I've seen it done before but not sure how to do it.

I tried:
style="background:url(year_bg.php?year=<?php echo $theyear; ?>); background-position:center; background-repeat:no-repeat;"

and year_bg.php =
<span style="color:#CCCCCC; font-size:48px; font-family:Georgia, 'Times New Roman', Times, serif;"><?php echo $_GET['year']; ?></span>

but that's not working...
 
background: url() will be expecting an image, not just some random outputted html text. In your php script, try to output the year as an actual image, so use GD library to write the number to an image and output that image as a result of the script. This would then be more of a php question, suited more in the forum434.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top