How to remove the default link color of html hyperlink "a" tag?
P粉432906880
P粉432906880 2023-08-23 16:28:59
0
2
900
<p>The default link color is blue. How to remove the default link color of html hyperlink tag <code><a></a></code><a>? </a></p>
P粉432906880
P粉432906880

reply all(2)
P粉884548619

Try something like this:

a {
    color: #0060B6;
    text-decoration: none;
}

a:hover {
    color:#00A0C6; 
    text-decoration:none; 
    cursor:pointer;  
}

If text-decoration doesn't work, change it to:

text-decoration: none !important;
The

!important rule overrides all other styles with the text-decoration attribute. You can read more about it here.

P粉403804844

Inherited value:

a { color: inherit; }

...will cause the element to take on the color of its parent (I think this is what you're looking for).

The live demonstration is as 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>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!