Search code examples
htmlcssanchor

How do I remove the default link color of the html hyperlink 'a' tag?


The default link color is blue. How do I remove the default link color of the html hyperlink tag <a>?


Solution

  • The inherit value:

    a { color: inherit; } 
    

    … will cause the element to take on the colour of its parent (which is what I think you are looking for).

    A live demo follows:

    a {
      color: inherit;
    }
    <p>The default color of the html element is black. The default colour of the body and of a paragraph is inherited. This
      <a href="http://example.com">link</a> would normally take on the default link or visited color, but has been styled to inherit the color from the paragraph.</p>