View Full Version : a:hover picture background


Skipperkirk
03-19-2005, 01:19 AM
ok, i have looked everywhere and i cant find out how to do this:

When i hover over a link, i want the background color (of the text link) to be an image...

thanks!

Skipperkirk

bejayel
03-19-2005, 01:30 AM
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="120" onclick="window.location.href('YOURLINKHERE')" onMouseOver="style.background='URL(image.gif)'" onMouseOut="style.background='URL(image.gif)'" style="cursor: hand;">

</td>
</tr>
</table>

I am not sure if what will work exactly, but it is the definite idea of what needs to eb done.

Skipperkirk
03-19-2005, 01:32 AM
ok, well i'll try that...


is there not a way i can like put it in my a:hover blah blah blah in my css? like background-picture or something?


thanks!

Skipperkirk

Monkey Bizzle
03-19-2005, 03:54 AM
shockertwin... i think you got confused... he asked how to change the background on a LINK, not a TABLE CELL

in the a:hover section of your CSS, add:

background-image: url(url of your image here);

Skipperkirk
03-19-2005, 04:19 AM
hmm, i tried and it didnt work...

kittycat
03-19-2005, 04:26 AM
Should work, can you post your code with that in?

Skipperkirk
03-19-2005, 04:34 AM
ok, i got it...thanks!

(i accdentally put .jpg and not.gif O.o)

Skipperkirk

bejayel
03-19-2005, 04:50 AM
i didnt knwo you could chang teh background of a link. My idea is that the link would go into the table, and the background of the table would change when the mouse went over it. I guess the other way wroks too, i just never knew about it.

DUANE
03-19-2005, 05:05 PM
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="120" onclick="window.location.href('YOURLINKHERE')" onMouseOver="style.background='URL(image.gif)'" onMouseOut="style.background='URL(image.gif)'" style="cursor: hand;">

</td>
</tr>
</table>

I am not sure if what will work exactly, but it is the definite idea of what needs to eb done.

Could you spell out exactly what goes in "YOUR LINK HERE". Do you put the whole code(<a href="xxxxx">xxxxx</a>)?
Many thanks

Monkey Bizzle
03-19-2005, 06:48 PM
just put the URL... not the <a href stuff. Like if you were linking to google for example:

onclick="window.location.href('YOURLINKHERE')"

becomes:

onclick="window.location.href('http://www.google.com')"

DUANE
03-19-2005, 07:45 PM
just put the URL... not the <a href stuff. Like if you were linking to google for example:

onclick="window.location.href('YOURLINKHERE')"

becomes:

onclick="window.location.href('http://www.google.com')"

It doesn't seem to work. Is there something wrong with this code:

<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="120" onclick="window.location.href('http://www.google.com')" onMouseOver="style.background='URL(http://img.photobucket.com/albums/v155/dupross/dogs1.gif)'" onMouseOut="style.background='URL(http://img.photobucket.com/albums/v155/dupross/worm.gif)'" style="cursor: hand;">

</td>
</tr>
</table>

Many thanks!

Skipperkirk
03-20-2005, 02:40 AM
i would use this-->

<a href="www.whatever.com" style="background-image: url(url of your image here);">LINK TEXT</a>

Skipperkirk
03-20-2005, 05:30 AM
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="120" onclick="window.location.href('YOURLINKHERE')" onMouseOver="style.background='URL(ima ge.gif)'" onMouseOut="style.background='URL(ima ge.gif)'" style="cursor: hand;">

</td>
</tr>
</table>


ok, im useing this for something too, but im tring to incorprate (sp?) a pop up with it...

im using the code:

from HERE (http://www.quasigeek.net/users/rewritable/simplepopup.php)

and this is my code (with the style stuff in my <head> of course):

<td onclick="window.location.href javascript:P('www.lissaexplains.com',200,200')" onMouseOver="style.background='URL(http://i3.photobucket.com/albums/y58/cadlewebimages/linkbg.jpg)'" onMouseOut="style.background='#ccba71'" style="border: solid 1px #000000; cursor: hand;">20</td>


How in the world do i do this?

thanks!

Skipperkirk