Recall & Review
beginner
What is the CSS <code>:hover</code> pseudo-class used for?The <code>:hover</code> pseudo-class applies styles to an element when the mouse pointer is over it, creating interactive effects.Click to reveal answer
beginner
How do you change the background color of a button when a user hovers over it?
Use CSS like
button:hover { background-color: blue; } to change the button's background color on hover.Click to reveal answer
intermediate
Can the
:hover state be used on touch devices?No,
:hover works with mouse pointers and is not reliable on touch devices, which use taps instead.Click to reveal answer
intermediate
Why should you use transitions with
:hover effects?Transitions make hover changes smooth and visually pleasing by animating the style changes over time.
Click to reveal answer
beginner
Write a CSS snippet to make a link text color change to red on hover with a smooth transition.
a { color: black; transition: color 0.3s ease; } a:hover { color: red; } Click to reveal answer
What does the CSS selector
button:hover target?✗ Incorrect
The :hover pseudo-class applies styles when the mouse pointer is over the element.
Which CSS property is commonly used with
:hover to make changes smooth?✗ Incorrect
transition animates property changes smoothly on hover.
Can
:hover styles be triggered on a smartphone by touching the screen?✗ Incorrect
Touch devices usually do not support hover, but some simulate it on first tap.
Which of these is a valid CSS rule to change text color on hover?
✗ Incorrect
:hover is the correct pseudo-class for mouse hover.
What happens if you do not use
transition with :hover?✗ Incorrect
Without transition, style changes happen immediately without smooth animation.
Explain how the CSS
:hover pseudo-class works and give an example of how to use it.Think about what happens when you move your mouse over an element.
You got /3 concepts.
Describe why adding a transition to hover effects improves user experience.
Consider how sudden changes feel compared to smooth ones.
You got /3 concepts.