Home  >  Article  >  Web Front-end  >  How to change the color of a focused link using CSS

How to change the color of a focused link using CSS

王林
王林forward
2023-09-02 18:57:021028browse

如何使用 CSS 更改焦点链接的颜色

Use the :focus class to change the color of the focused link. Possible values ​​can be any color name in any valid format.

Example

You can try running the following code to achieve focus color linking -

<html>
   <head>
      <style>
         a:focus {
            color: #0000FF
         }
      </style>
   </head>
   <body>
      <a href = ""> This is demo link </a>
   </body>
</html>

The above is the detailed content of How to change the color of a focused link using CSS. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete