Home > Article > Web Front-end > How to set link color in css
In CSS, you can use the ":link" pseudo-class selector to set the link color. You only need to set "a:link{color:color value;}" for the a element. The ":link" selector is used to select an unvisited link and then add the desired style to the link.
The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.
: The link selector is used to select unvisited links.
Grammar:
a:link{color:blue;}
Example:
<!DOCTYPE html> <html> <head> <style> a:link {color:blue;} </style> </head> <body> <p>将鼠标指针移动到这个链接上:<a href="http://cctv.com">cctv</a></p> </body> </html>
Result:
The above is the detailed content of How to set link color in css. For more information, please follow other related articles on the PHP Chinese website!