Home > Web Front-end > CSS Tutorial > How to remove the default style of a tag in css

How to remove the default style of a tag in css

WBOY
Release: 2021-11-24 18:15:08
Original
22178 people have browsed it

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.

How to remove the default style of a tag in css

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

Output result:

How to remove the default style of a tag in css

##The default style of an a tag is:

How to remove the default style of a tag in css

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!

Related labels:
css
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