Home >Web Front-end >CSS Tutorial >How to achieve the non-discoloration effect of a tag in css
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.
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:
##(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!