Computer >> Computer tutorials >  >> Programming >> CSS

Removing the Links Default Underlines using CSS


To remove the links default underlines using CSS, the code is as follows −

Example

<!DOCTYPE html>
<html>
<head>
<style>
a:link {
   color: blue;
   text-decoration: none;
}
a:visited {
   color: blue;
   text-decoration: none;
}
</style>
</head>
<body>
<h1>Demo Heading</h1>
<div>
<p>This is the <a href="https://tutorialspoint.com">reference</a></p>
</div>
</body>
</html>

Output

Removing the Links Default Underlines using CSS

Example

Let us now see another example −

<!DOCTYPE html>
<html>
<head>
<style>
a:link {
   color: blue;
   text-decoration: none;
}
a:hover {
   color: blue;
   text-decoration: none;
}
a:active {
   color: blue;
   text-decoration: none;
}
</style>
</head>
<body>
<h1>Demo Heading</h1>
<div>
<p>This is the <a href="https://tutorialspoint.com">reference</a></p>
</div>
</body>
</html>

Output

Removing the Links Default Underlines using CSS