Next-Gen App & Browser
Testing Cloud

Trusted by 2 Mn+ QAs & Devs to accelerate their release cycles

Next-Gen App & Browser Testing Cloud

How to target a link in CSS?

The :link CSS selector targets the unvisited link. To style links that have already been visited, use “:visited”; to style links that have been clicked on, use “:active”; and to style a link while the mouse is over it, use “:hover”.

For example, because most browsers apply a special color to visited links, the links in this example will probably have special font colors only before you visit them. But you'll need to check your browser history to see them again because the background-color value will likely remain even after you've visited the links.

CSS Syntax:


a:link {
  background-color: gold;
  color: green;
}

Test your website on 3000+ browsers

Get 100 minutes of automation test minutes FREE!!

Test Now...

KaneAI - Testing Assistant

World’s first AI-Native E2E testing agent.

...
ShadowLT Logo

Start your journey with LambdaTest

Get 100 minutes of automation test minutes FREE!!

Signup for free