Skip to content

WebDevHubs

  • Home
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • Java
  • Selenium
  • PHP
  • Python
  • Programs
  • Toggle search form

How to Remove Underline From Link in HTML?

Posted on July 22, 2025July 22, 2025 By Admin No Comments on How to Remove Underline From Link in HTML?

To remove the underline from a link in HTML, use the CSS property text-decoration: none; on your <a> (anchor) tags. Browsers add underlines to links by default, but you can easily override this with CSS.

Methods to Remove Underlines

1. Inline CSS

Apply style="text-decoration: none;" directly to the link:

<a href="https://example.com" style="text-decoration: none;">
    No Underline Link
</a>

This only affects the specific link where the style is applied.

2. Internal CSS

Add a <style> section in the <head> to target all links on the page:

<head>
    <style>
        a {
            text-decoration: none;
        }
    </style>
</head>
<body>
    <a href="https://example.com">Link without underline</a>
</body>

This removes underlines from every link on the page.

3. External CSS

If you are using a separate CSS file, add:

a {
    text-decoration: none;
}

This will remove underlines from all links site-wide.

4. Covering All Link States

For complete consistency across all link states (normal, visited, hover, active), target each pseudo-class:

a:link,
a:visited,
a:hover,
a:active {
    text-decoration: none;
}

This ensures the underline never reappears when the link is hovered or clicked.

HTML, Web Technologies Tags:html-Questions

Post navigation

Previous Post: How to Increase Font Size in HTML?
Next Post: How to Add Icon in HTML?

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Categories

  • CSS
  • HTML
  • Interview Experience
  • Java
  • JavaScript
  • Lodash
  • PHP
  • Programs
  • Python
  • Selenium
  • Software Testing
  • Web Technologies
  • Web Templates

Recent Posts

  • Java ArrayList trimToSize() Method
  • Java ArrayList toArray() Method
  • Java ArrayList subList() Method
  • Java ArrayList spliterator() Method
  • Java ArrayList sort() Method

Recent Comments

No comments to show.

Important Pages

  • About Us
  • Contact Us
  • Terms of Use
  • Privacy Policy

Web Development

  • HTML
  • CSS
  • JavaScript
  • PHP

Programming Languages

  • Java
  • Python
  • PHP
  • Programs

Others

  • Selenium
  • Lodash
  • Java ArrayList
  • JavaScript Array Methods

Copyright © 2025 WebDevHubs.

Powered by PressBook Green WordPress theme