Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change text color on mouse over using the style tag

Tags:

html

css

hover

Using CSS it's easy to apply a custom color to a link when you hover over it using:

.myId:hover{
    color:green;
}

But what about the style tag? It is possible to do something along the lines of:

<a style="*insert nifty markup here to change color on hover*" href="somewhere.html">text</a>

Or is changing the hover color only possible trough the first method (using only html/css, no javascript allowed).

like image 434
Pieter888 Avatar asked Jan 20 '23 08:01

Pieter888


1 Answers

You cannot and should not do this. Give it a class or id, and a stylesheet.

like image 55
David Houde Avatar answered Jan 22 '23 21:01

David Houde