In this example, we will learn how to remove underline from anchor tags or links using CSS. The underline is set by default in the anchor tags where href
is specified. We can remove this default underline using text-decoration: none
.
HTML
<a href="#">This is default</a>
<a href="#" class="remove">Underline removed</a>
CSS
.remove {
text-decoration: none;
}
Output
Here, we remove the underline from the link that was set by default in the <a>
tag. We can also change the color of the text using the color
property.
In this example, we learned how to remove underline from anchor tags or links using CSS. We used the text-decoration: none
value to remove the underline.