Jump to content

Add Mouseover and link to image


Coreper
 Share

Recommended Posts

ive got this image [Header_Logo.png] and i want to add a mouseover image [Header_Logo_Active.png] and a hyperlink [index.htm] to it

does anyone know how to do this?

here is my image code:

<img border="0" src="../images/header/Header_Logo.png" width="280" height="260">

note: i dont want to use javascript, i would really like to use NO scripts and simple codes...

thanks in advance

Link to comment
Share on other sites

Goes in head tag

<style type="text/css">

.hoverlink a:hover{

background-image:url('hoverpic.png');

width:xxxpx;

height:xxxpx;

}

.hoverlink a{

background-image:url('nonhoverpic.png');

width:xxxpx;

height:xxxpx;

}

</style>

your link

<a href="anotherpage.html" class="hoverlink"></a>

Link to comment
Share on other sites

it doesnt work

here is what i did:

i added to the body:

<a href="home.htm" class="hoverlink">
<img border="0" src="../images/header/Header_Logo.png" width="280" height="260"></a>

i added to the header:

<style type="text/css">
.hoverlink a:hover{
background-image:url('../images/header/Header_Logo_Active.png');
width:280px;
height:260px;
}
.hoverlink a{
background-image:url('../images/header/Header_Logo.png');
width:280px;
height:260px;
}
</style>

the image does show a hyperlink [in the status bar], but the image doesnt change when the mouse hovers above it...

Link to comment
Share on other sites

no i havent got it up yet

but

a friend of mine told me another, much easier way:

<img border="0" name="Logo" src="../images/header/Header_Logo.png"
onmouseover="Logo.src='../images/header/Header_Logo_Active.png'"
onmouseout="Logo.src='../images/header/Header_Logo.png'" width="280" height="260">

Thats exactly what i was looking for!!!

thanks for the help though!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy