Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Force link to look not visited using CSS

Tags:

css

visited

Is there a way to use CSS to make a given link appear as it is not visited, even if it has already been visited?

I know you can do this by explicitly setting the same color for the visited and non-visited links. But is it possible to do this without hardcoding the color of the visited links? Just telling the CSS to color them using the same color as the non-visited links, whatever that may be.

The reason for this is that I want to Rickroll a friend.

like image 409
hugomg Avatar asked Nov 28 '25 11:11

hugomg


1 Answers

You can leverage the inherit property:

a:visited {
  color: inherit;
}

Another option is to use !important:

a {
  color: red !important;  
}
like image 198
barhatsor Avatar answered Nov 30 '25 05:11

barhatsor



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!