Solved

how do I make a href change colors when the cursor is over it  using style sheets?

Posted on 2004-09-03
4
181 Views
Last Modified: 2012-06-27
Can anyone tell me how to do this?

Cheers,
Rick
0
Comment
Question by:richardsimnett
  • 2
4 Comments
 
LVL 10

Expert Comment

by:kiranghag
ID: 11978726
0
 
LVL 36

Accepted Solution

by:
Zyloch earned 200 total points
ID: 11978764
Hi

Basically, you do this:

<html>
<head>
<style type="text/css">
a:link {color:blue;}
a:hover {color:red;}   /*This is when mouse is over link*/
</style>
</head>
<body>
<a href="http://www.google.com/">Google</a>
</body>
</html>

Regards,
Zyloch
0
 

Author Comment

by:richardsimnett
ID: 11978846
Zyloch,
   Ok, that works almost perfectly. Problem is how to make it stay blue as the link color after it has been clicked....

Cheers,
Rick
0
 
LVL 36

Expert Comment

by:Zyloch
ID: 11978900
a:visited {color:blue;}
a:active {color:blue;}
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

This is a how to build your own CSS3 slideshow and when I say CSS3 I mean just CSS with no javascript in sight! There a few examples online of how to do this but most just show you an example without any explanation, others make it more complicat…
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
In this tutorial viewers will learn how to define a gradient in CSS. Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Gradient. Define the background as "linear-gradient(to right, #ee3668, black)". Ensure you …
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now