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.
Loading...
Related Quiz
- You have an element inside a container. The container has a font-size of 20px. If you set the child element's font-size to 1.5em, what will be its computed font-size?
- If two conflicting styles affect an element, how does the browser decide which one to apply?
- How would you ensure that an element remains in the normal document flow, even if its siblings are floated?
- One of the benefits of CSS-in-JS solutions is that they can prevent unused styles, leading to ________.
- Which extension is used for SCSS files?