Table Maker3schools TranslateImage CompressorFavicon Icon GeneratorCrop & Resize Image
Apu
Apu November 27, 2022 . #anchor . #css

How to Change the Color of Active Links with CSS

To change the colour of active link, we can use the CSS :active pseudo class.

As you know browsers set a default color on links.

  1. An unvisited link is underlined and blue.
  2. A visited link is underlined and purple.
  3. An active link is underlined and red.

So, use the CSS :active pseudo class to change the colour of a active link.

<style> 
  a:active{
    color:gold
  }
</style>
<a href="https://www.3schools.in"> Visit 3schools</a>

Whenever you hover over the above link it will turn gold color.

save
listen
AI Answer
Write Your Answer
loading
back
View All