The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Changing text to an image
pk941
post Aug 22 2008, 01:26 PM
Post #1


Member
***

Group: Members
Posts: 50
Joined: 1-January 07
Member No.: 1,426



Is there an easy way, perhaps with CSS, to change text to an image when the pointer hovers it. I know how to change the color of texts in a table (thanks to your help) but know this is another challenge, at least for me. What I am trying to do is to create a menu. I have a table with a background image. In the table is a list. What I would like to do is when the pointer hovers over a particular word in the list it changes to an image. Here's what I mean.... I have a list of fruit....apple, pear, orange. When the pointer hovers over the word"apple" an image of an apple appears in place of ( or covering) the word "apple". I hope this is clear.

How can I do this?

thanks
pk

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Aug 22 2008, 03:15 PM
Post #2


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



So the text is a link, right? Yes, you can do that with CSS. Show a background image on :hover and at the same time make the text dissappear. For that you need to nest a SPAN inside the A.

CODE

a:hover        { background: url(http://htmlhelp.com/icon/wdglogo.gif) }
a:hover span   { visibility: hidden }


HTML
<a href="http://htmlhelp.com"><span>HTML Help</span></a>


For this to look good you may want to make the links 'display: block' or float them so you can use width and height. Depends on the layout and the images, I guess.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 23rd April 2024 - 11:47 AM