Home › Forums › JavaScript › Change Active Link Color › Reply To: Change Active Link Color
May 9, 2016 at 3:40 pm
#241422
Mottie
Member
I can think of two different ways to accomplish this:
- If the user can back the background color, allow them to choose the link colors as well: link, hover, active and visited.
- If you don’t want to do that, then maybe use javascript to find the complimentary colors
Then add the :active
color inside a style. Something like this:
var activeLink = "#d00",
styleElm = document.createElement("style");
styleElm.textContent = "a:active { color: " + activeLink + "}";
document.querySelector("head").appendChild(styleElm);