Home  >  Article  >  Web Front-end  >  How to remove underline from css hyperlink

How to remove underline from css hyperlink

醉折花枝作酒筹
醉折花枝作酒筹Original
2021-04-21 14:00:0628010browse

In CSS, you can use the text-decoration attribute to remove the underline of a hyperlink. You only need to set the "text-decoration:none" style to the a tag. The text-decoration attribute specifies the decoration added to the text. When the value is none, it means no text decoration.

How to remove underline from css hyperlink

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

We know that CSS is generally not initialized, and the text with hyperlinks in the web page will be underlined. If we want to remove the underline, how should we set it up? Next, divcss5 will introduce to you how to remove the underline style of html a hyperlink.

1. Remove the underline css style

Let’s get to know the following CSS attribute words. If we want to remove the underline of a hyperlink anchor text, we will use the following CSS style words:
text-decoration setting Underline style word

To remove the underline style of a hyperlink, we can set the value of css text-decoration to "none".
Remove A link underline style code as follows:
a{text-decoration:none}

2. Case of removing anchor text underline

Next, we will introduce the case of removing superline through css Link underline style.
HTML code

<!DOCTYPE html> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<title>document</title> 
</head> 
<body> 
想要带你去浪漫的<a href="https://baike.baidu.com/item/%E5%9C%9F%E8%80%B3%E5%85%B6/198448?fr=aladdin">土耳其</a>! 
</body> 
</html>

Screenshot

Before removing the underline

How to remove underline from css hyperlink

Use css to remove the hyperlink underline
css code snippet

a{
 text-decoration:none
 }

How to remove underline from css hyperlink

Recommended learning: css video tutorial

The above is the detailed content of How to remove underline from css hyperlink. 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