By default, all CSS links are decorated with an underline. But, there may be a situation, when we want to remove these underlines from the links. For example, creating a navbar, side menu, etc.
To remove the underline from CSS links, we can use the text-decoration property. Simply set the text-decoration
property to none
and this will completely remove any existing under or overline from the link. Try out the example below to check how it works:
Example:
a{ text-decoration: none; }
We can also use the text-decoration
property to remove underlines from the links when we hover over them. Refer to the example below:
Example:
a:hover{ text-decoration: none; }