You could do something like this:
a{
color: black;
}
a:hover{
color: red;
}
a:active{
color: blue;
}
<a href="index.html">Clic</a>
We use the sentence:
a{
color: black;
}
To indicate the color Black , to the elements of type <a>
.
We use the sentence:
a:hover{
color: red;
}
To indicate the color Red , to the elements of type <a>
, when the mouse is passed over them.
Update
We use the sentence:
a:active{
color: blue;
}
To indicate the color Blue , to the elements of type <a>
, when you press with the mouse on them. That is, when you click.
Update 2
If you want to do everything in a single line (although it is not recommended because you could not centralize the design in another file) .
You could do something like this:
<a href='index.html' style='color: black'>Clic</a>
Although this would only work for the color in general , but not for the events hover
or active
.