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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using CSS for mouseover changes to text hyperlinks 1

Status
Not open for further replies.
Oct 22, 2001
28
GB
Hi

I've been using CSS to control mouseover changes on text hyperlinks, e.g.

A:hover
{
color: #669999;
font-family: Arial;
font-size: 9pt;
text-align: center;
text-decoration: none;
}

resulting in the text colour changing when user moves the mouse over the text link. I would like two have different mouseover colours on different parts of the page (e.g. navigational buttons would change to one colour and links in the body text change to another colour).

Does any one know how I could do this using CSS (or any other means)?

I hope that this makes sense and would be very grateful for any thoughts or advice anyone has.
 
Hi,

you need to assign a separate class to each of the link types that you want.

For example:

In your stylesheet...
Code:
a.example1  {color: #003399}
a.example1:hover {color: #993300}

a.example2  {color: #FFFFFF}
a.example2:hover {color: #000000}
In your code...
Code:
<A HREF=&quot;page1.htm&quot; CLASS=example1>example 1 text</A>

<A HREF=&quot;page2.htm&quot; CLASS=example2>example 2 text</A>
Hope this is what you are after

regards

Tony
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top