Changing link color on mouse movement over the link.

Asked By 10 points N/A Posted on -
qa-featured

I need to change the link color during moving mouse over the link in HTML. What to do for this purpose?

SHARE
Answered By 15 points N/A #143456

Changing link color on mouse movement over the link.

qa-featured

If you need to have a link that changes it's color whenever you hover you mouse over it here is a simple code you need to paste on "HEAD" section of your html code.

<style type="text/css">
<!–
A:link { COLOR:red ; TEXT-DECORATION: none; font-weight: normal }
A:hover { COLOR: pink; TEXT-DECORATION: none; font-weight: none }
–>
</style>
 
Explanation on how it works:
 
"A:link" – this part will set what color your links will show on the webpage your are going to create.
"A:hover" – and this part will set what color the link changes to whenever you hover or move your mouse on it.
 
Some other useful codes:
 
"A:active" – this will set the color of the links after being clicked "A:visited" – this will set the color of the link if it had already been clicked."text-decoration" – this would allow you if you want to add underline on a link. Type in "underline" if you want it or "none" if you don't.

Related Questions