Role of CSS :active Selector


Use the CSS :active selector to style the active links. You can try to run the following code to implement the :active selector −

Example

Live Demo

<!DOCTYPE html>
<html>
   <head>
      <style>
         a:active {
            background-color: orange;
         }
      </style>
   </head>
   <body>
      <a href = "https://qries.com">Welcome to Qries</a>
      <p>Click on the above link to see the effect.</p>
   </body>
</html>

Updated on: 30-Jun-2020

190 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements