Home  >  Article  >  Web Front-end  >  How to remove underline in css a

How to remove underline in css a

藏色散人
藏色散人Original
2023-01-28 15:07:414028browse

css a method to cancel underline: 1. Create an HTML sample file; 2. Add a tag to the body; 3. Add "#none{text-decoration: none;}" to the specified a tag Just cancel the underline.

How to remove underline in css a

The operating environment of this tutorial: Windows 10 system, css3 version, DELL G3 computer

How to cancel the underline in css a?

Remove the underline in the a tag:

In the development web page, the hyperlink set by the a tag will have a underline in the performance, but Many times that underline is not pretty. So how do we get rid of it? This article tells you how to remove the underline in the a tag.

  • text-decoration attribute

The text-decoration attribute is used to set the underline attribute of the a tag. Its attribute values ​​are:

none: remove the underline

underline: set the underline

overline: set the line above the text

line-through: on the text Set the line in the middle

initial: default value

inherit: inherit from the parent element

Let’s take a look at the specific code and implementation effect:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>a标签划线</title>
<style type="text/css">
#none{
text-decoration: none;
}
#overline{
text-decoration: overline;
}
#overline{
text-decoration: line-through;
}
</style>
</head>
<body>
<a href="">这是正常样式</a><br>
<a href="" id="none">无下划线</a><br>
<a href="" id="overline">上划线</a><br>
<a href="" id="line-through">中划线</a><br>
</body>
</html>

Implementation Effect:

How to remove underline in css a

Recommended study: "css video tutorial"

The above is the detailed content of How to remove underline in css a. 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
Previous article:What does $ in jquery do?Next article:What does $ in jquery do?