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

How to set link color in css

醉折花枝作酒筹
Release: 2023-01-05 16:11:15
Original
6621 people have browsed it

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;}
Copy after login

Example:

<!DOCTYPE html>
<html>
<head>
<style>
a:link    {color:blue;}
</style>
</head>
<body>

<p>将鼠标指针移动到这个链接上:<a href="http://cctv.com">cctv</a></p>

</body>
</html>
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template