Home >Web Front-end >CSS Tutorial >How to achieve the non-discoloration effect of a tag in css

How to achieve the non-discoloration effect of a tag in css

WBOY
WBOYOriginal
2021-12-01 18:29:298144browse

In CSS, you can use the color attribute to achieve the non-discoloration effect of the a tag. Setting this attribute can make the a tag not change color before or after clicking. You only need to add "color: color value" to the a tag. ;" style is enough.

How to achieve the non-discoloration effect of a tag in css

The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.

How to achieve the non-discoloration effect of a tag in css

You can set the color of a tag through the color attribute, so that whether it is before clicking the a tag or It won't change color after clicking.

The color attribute specifies the color of the text.

This attribute sets the foreground color of an element (in HTML representation, the color of the element's text); raster images are not affected by color. This color also applies to all borders of the element, unless overridden by border-color or another border-color property.

To set the foreground color of an element, the easiest way is to use the color attribute.

The example is as follows:

<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="content-type" content="text/html;charset=utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>title</title>
</head>
<a href="https://www.php.cn/course/list/12.html" target="_blank">css视频教程</a>
    <style>
a{
    color: #000000;
    } 
    </style>
</body>
</html>

Output result:

How to achieve the non-discoloration effect of a tag in css

##(Learning video sharing:

css video tutorial

The above is the detailed content of How to achieve the non-discoloration effect of a tag 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