P粉8845486192023-08-24 13:50:34
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粉4038048442023-08-24 00:19:50
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>