QP School
Pseudo-classes in CSS3 - Printable Version

+- QP School (https://qomplainerzschool.lima-city.de)
+-- Forum: Tutorials (https://qomplainerzschool.lima-city.de/forumdisplay.php?fid=3)
+--- Forum: CSS3 Tutorials (https://qomplainerzschool.lima-city.de/forumdisplay.php?fid=5)
+--- Thread: Pseudo-classes in CSS3 (/showthread.php?tid=5173)



Pseudo-classes in CSS3 - Qomplainerz - 07-26-2023

Example:

<!DOCTYPE html>
<html>
<head>
  <title>Pseudo-classes Example</title>
  <style>
    /* Style the link when hovered */
    a:hover {
      color: red;
    }
  </style>
</head>
<body>
  <a href="#">Hover over this link</a>
</body>
</html>

Explanation:

Pseudo-classes target elements based on their state or user interaction. In this example, the a:hover pseudo-class selects the anchor (<a>) element when the user hovers over it and applies a red color to the text. When you hover over the link, the text turns red.