How to remove underline from hyperlink in css

php中世界最好的语言
Release: 2017-11-20 16:07:29
Original
8893 people have browsed it

It is inevitable that there are several pairs of text Ahyperlinkanchor text in a web page, but by default all text with links have underline effects, so how to make this hyperlink How about removing the underline effect from the link? Then we have to use powerful CSS.

To make the default underline disappear in the font text with hyperlink anchor text through CSS settings, we need the CSS style word text-decoration to remove the underline.

The specific CSS code to remove the underline from the default link in the entire web page to achieve no underline is as follows:

a{text-decoration: none}

The above CSS code can cancel the underline removal.

DIV CSS knowledge expansion, the default link has no underline effect, when the mouse moves over the corresponding text and hovers, the corresponding text font will be underlined, CSS style code:

a{text-decoration : none} 
a:hover{text-decoration:underline}
Copy after login

This will make the web page with The underline of the link text disappears by default, but the underline style effect appears when the mouse is moved and hovered over the anchor text.

The following is that by default, the text with the link is not underlined, and a CSS underline appears when the mouse is hovering over the anchor text font.

Complete HTML source code of the example:

<!DOCTYPE html> 
<html> 
<head> 
<meta charset="utf-8" /> 
<title>无下划线实现 DIVCSS5</title> 
<style> 
a{ text-decoration:none} 
a:hover{ text-decoration:underline} 
</style> 
</head> 
<body> 
欢饮来到<a href="//m.sbmmt.com">m.sbmmt.com</a>关于默认链接无下划线实例 
</body> 
</html>
Copy after login

Related reading:

js implementation of automatic triggering of hyperlink examples when the page is loaded

How to use jQuery to dynamically modify hyperlinks

Summary of usage examples of hyperlink a in html

The above is the detailed content of How to remove underline from hyperlink in css. For more information, please follow other related articles on the PHP Chinese website!

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