Is it possible to keep the color on a link with a class while other links do change.
For example I have a theme but i want it to support different colors set by the user.
Most links change color on :hover but some must stay the same color.
#red is generated by the theme. I want to 'inherit' the a.someclass:link
color in the a.someclass:hover
example:
a:link
{
color: #red;
}
a:hover {
color: #black;
}
The above part is generated which I cannot alter.
As suggested in answers and comments below I need to build this with jQuery
sure I can copy #red to the a.someclass:hover {}
but then i have to hardcode the color and since the user should be able to change the color that is not an option.
I need something to overide the a:hover { color }
if the class is someclass
Changing link color on hover using CSS To change the color of your link on hover, use the :hover pseudo property on the link's class and give it a different color.
To change the background color of the button, use the CSS background-color property and give it a value of a color of your taste. In the . button selector, you use background-color:#0a0a23; to change the background color of the button.
The :hover selector is used to select elements when you mouse over them. Tip: The :hover selector can be used on all elements, not only on links. Tip: Use the :link selector to style links to unvisited pages, the :visited selector to style links to visited pages, and the :active selector to style the active link.
You can make use of currentColor
a.no-color-change:hover {
color: currentColor;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With