quick HTML onmouseover question

JoeKing

Lifer
Oct 9, 1999
10,641
1
81
I forgot how to specify for individual text link an onmousover command for a link to change color, then return to that color. HTML wizzies help requested. Some midnight site redesigning going on here. :D

example
<a href="blebleble.htm">Text To change color</a>

 

gopunk

Lifer
Jul 7, 2001
29,239
2
0
the only way i know (other than javascript) is to use css. in other words, i don't think you can do it in straight html.

in css, it's the a:hover attribute.
 

gopunk

Lifer
Jul 7, 2001
29,239
2
0
well it's just like any other css...

a:hover {color: blah; other stuff if you want it}
 

Burnt

Platinum Member
Mar 20, 2001
2,211
0
0
<head>
<title>blah</title>
<style>
A:link {color: navy;}
A:visited {color: darkblue;}
A:active {color: blue;}
A:hover {color: red;}
</style>
</head>
 

JoeKing

Lifer
Oct 9, 1999
10,641
1
81
yeah I already have that set on top of my pages, the thing is I want to be able to specifically state for an individual link if I say wanted it to be yellow that it would take would be yellow while my global settings would be say blue. I remeber I had some code that did that a few years ago, but I have since lost it.

gopunk,
It sort of looks like that, but where would I place it in the link? Could you give me a specific example where the code is implemented?
like would it go
<a href="bleh.htm">a:hover {color: Blue; Text to highlight}</a>? cuase it doesnt seem to work. I vaguly remeber the old code I had looked a lot like this.
 

bjb86s

Senior member
Aug 8, 2001
494
0
0
The CSS goes in a seperate file (*.css) and then you call in it the html file w/

<LINK REL="StyleSheet" HREF="default.css" TYPE="text/css">

If you want each link to be a seperate color, javascript is the way to go:

<DIV class=blue13>
<a href="link.html" onMouseOver="this.style.color='#669900'; return true;" onMouseOut="this.style.color='#4b4b4b';">link</a> </DIV>