Which pseudo-class would you use to target an element when it's being hovered over by a mouse pointer?

  • :active
  • :focus
  • :hover
  • :visited
The :hover pseudo-class is used to target an element when it's being hovered over by a mouse pointer. This is commonly used to apply styles or behaviors to elements when a user hovers their cursor over them. For example, you can change the background color of a button when it's hovered over to provide feedback to the user.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *