Previous Message
Next Message

Title Tag for Background Image

Sent by Erik Peterson on 16 February 2005 19:07


Jeff Gates wrote:

<lots of stuff snipped>

>Here's an interesting problem:
>
>We use a series of background images on our front page
>(http://americanart.si.edu). Each time a user goes to that page or refreshes
>another image appears randomly.  I'd like to put some descriptive text
>(giving some specific information about that image) when someone rolls over
>it. 
>
>Is there a way to do this (fairly easily would of course be best in this
>reverse engineering project -g)?
>
>#splash3
>	{
>	background-image: url(images/thayer_background2.jpg);
>	}	
>	
>
>Thanks,
>Jeff
>  
>

Hi Jeff,

It looks like you're using ColdFusion to provide server-side decisions 
about which random image is displayed and supplying a new stylesheet for 
each.

You can't directly title an image that's used in CSS, only when it 
appears in the HTML as an img element.  Seems as though those images are 
actually as much content as they are presentation and you might consider 
making them part of the markup, but that might be that 
reverse-engineering you were talking about.

Or, you can try putting a title attribute on the splash3 div in the HTML:

    <div id="splash3" title="Really Descriptive text goes here...">

 and having the same CF code that decides which image (i.e., which 
second stylesheet) to use also figure out which value to use.

Hope that is helpful,
Erik

--
Erik Peterson
http://www.elementalmarkup.com/
______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Previous Message
Next Message

Message thread:

Possibly related: