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!

Hover on <a> tag - background style 1

Status
Not open for further replies.

crabsodyinblue

Programmer
Aug 22, 2001
14
0
0
Without the use of frames.

<A> links using style sheets.

Can anyone tell me if it is possible to decorate the background of 2 different <a href=&quot; &quot;> links using a different colour background on hover over for different links.

For example I have a navigation table on the left hand side of my page which contains a list of various links. As I have a few similar pages ,

For the links &quot;<a href=&quot; &quot;> on the left hand side I want to change the background to coral on a mouseover

Also on the right hand side of my page I have a section of code , which also contains a few links. Is it possible to change the back ground of these links to a different colour on a mouseover.


---------------- EXAMPLE links in area A ,
| | | I want with a coral(red) background
| | | on a hover (mouseover)
| A | B |
| | | Links in area B
| | | I want with a yellow/sandy
----------------- background on mouseover.


I was using the following code for the whole of the page. but ideally I will need two versions or something.

<STYLE TYPE=&quot;text/css&quot;>
<!--
A:link {background:white;color:&quot;black&quot;;}
A:visited {background:white;color:&quot;black&quot;;}
A:hover {background:#fff7cb;color:&quot;red&quot;;}
a{text-decoration:none}
-->
</STYLE>

Thanks in advance.

 
<STYLE TYPE=&quot;text/css&quot;>
<!--
A {text-decoration:none}
A:link {background:white;color:&quot;black&quot;;}
A:visited {background:white;color:&quot;black&quot;;}
A.style1:hover {background:#fff7cb;color:&quot;red&quot;;}
A.style2:hover {background:#ccff99;color:&quot;blue&quot;;}
-->
</STYLE>

... <a href=&quot;x&quot; class=&quot;style1&quot; .. etc.

Cheers,

Tom
 
Thanks Tom

it works a treat, just what I was looking for.

Cheers
Glenn
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top