CSS – Remove Underline for Anchor Element

To remove underline for anchor element using CSS, set text-decoration CSS property with none for the anchor element.

In the following example, we have two anchor elements. The first <a> with id="a1" is with default CSS. The second <a> with id="a2" is set with text-decoration:none in CSS.

Example

</>
Copy
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <style>
        #a2 {
            text-decoration: none;
        }
    </style>
</head>
<body>
    <a id="a1" href="#">Default Link </a>
    <br><br>
    <a id="a2" href="#">Link with no underline</a>
</body>
</html>

Conclusion

In this CSS Tutorial, we learned how to remove underline for anchor element using CSS.