Give a button feedback for both mouse and keyboard users.
What to build
One rule, applying to two states.
Requirements
.save:hoverand.save:focus-visibleboth have a background oftealand a text colour ofwhite.- They share one rule, using a comma.
Constraints
Do not write outline: none.
Example
a:hover, a:focus-visible { color: crimson; }
Why it works
Keyboard users never trigger hover, so both states need the same feedback.
Hints
Hint 1
Group the two selectors with a comma.
Hint 2
Do not remove the outline.
Solution
Show one correct solution (try it yourself first)
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>States</title>
<style>
.save:hover, .save:focus-visible {
background: teal;
color: white;
}
</style>
</head>
<body>
<button class="save">Save</button>
</body>
</html>