Home  >  Article  >  Web Front-end  >  How to set link color in css

How to set link color in css

醉折花枝作酒筹
醉折花枝作酒筹Original
2021-04-25 17:43:036569browse

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.

How to set link color in css

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:

How to set link color in css

## Recommended learning:

html video tutorial

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn