In CSS, you can use the "text-decoration" and color attributes to remove the default style of the a tag. You only need to add "a{text-decoration:none;color:#000;} to the a tag element. "Style is enough.
The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.
How to remove the default style of a tag in css
In css, we can add it through the text-decoration attribute and the text-decoration attribute. To modify the text, it can be used to remove the underline of the a tag.
There is also a color attribute, which can be used to set the font color of a tag.
Let’s take a look at the example below:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> </head> <style type="text/css"> a{ text-decoration: none; /* 去除默认的下划线 */ color: #000; /* 去除默认的颜色和点击后变化的颜色 */ } </style> <body> <a href="https://www.php.cn/" target="_blank">这是一个a标签</a> </body> </html>
Output result:
##The default style of an a tag is:In this way, we have removed the default style of the a tag through the text-decoration attribute and color attribute. (Learning video sharing:
css video tutorial)
The above is the detailed content of How to remove the default style of a tag in css. For more information, please follow other related articles on the PHP Chinese website!