Many people on the Web page to achieve different links have different colors do not know how to deal with, if you change the properties of a, as if all the color of the link changed.
Four hyperlinks in the state of the corresponding CSS properties: a{}, a:hover{}, a:visited{}, a:active{}, usually only write a{}, a:hover{}, if you need the other two font color settings, please refer to the order to write
a{color:red;}
A:visited{color:green;}
a:hover {color:yellow;background:blue;}
a:active {color:lime;background:red;}
Emit a different font color setting tip: When the text is selected with the font and background color (the default is blue white), this default effect can be changed by the following settings.
::-moz-selection {background: #d3d3d3; color: #555;}
::-webkit-selection {background: #d3d3d3; color: #555;}
:: Selection {background: #d3d3d3; color: #555;}
In fact, using CSS style to achieve this effect is relatively simple.
First look at the common settings:
A:link the Normal style of a hyperlink
A:visited clicked on
A:hover when the mouse passes through the
A:active when clicked
A:link{text-decoration:none;} No underline
A:link{text-decoration:underline;} With underline
To achieve different links, we want to define a CSS rule for that link for different effects.
Like what:
Our regular CSS is like this:
A:link{color: #ff0000}
So the color of all the links on the page is: #ff0000.
Now let's change:
A:link{color: #ff0000}
. line1 A:link{color: #000000}
Also, before you want to change the color of the link before adding CSS definition, like this: <span class=line1><a href= "/" > different colors of hyperlinks </a></span> The color of the link changes.