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 text

Status
Not open for further replies.

ttruluck

IS-IT--Management
Mar 8, 2001
10
0
0
ZA
Hi

I want the text of a link to change color when the mouse hovers over it. How do I do this?
 
I would create a style sheet which will apply the text effect in all pages that references it. Doing it this way means that you only have to put one line in at the top of each page, instead of mucking around with your code each time you want to apply the colour change.

1. Create an empty file in your web and name it my_style_sheet.css.

2. Type and save the following lines in "my_style...":
Code:
a { color: #326bab; text-decoration: none }
a:hover { color: #8297b1; text-decoration: none }
Make sure you don't have any other code on the page.

3. In your html page within the <head> tags type:
Code:
<link href=&quot;my_style_sheet.css&quot; rel=stylesheet type=text/css>
Type this line on any page you wish the colour change effect to take place.

This should work for you.

Craig
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top