Focus Ring with Outline Offset
CSS
Medium
3 views
Problem Description
Make an input focus ring that has space using outline-offset.
Output Format
Print the HTML+CSS code in one block.
Constraints
Use :focus-visible and outline-offset.
Official Solution
<!doctype html>
<html lang='en'>
<head>
<meta charset='utf-8'>
<meta name='viewport' content='width=device-width, initial-scale=1'>
<title>meetcode</title>
<style>
input { padding: 10px 12px; border: 1px solid #bbb; border-radius: 12px; }
input:focus-visible { outline: 3px solid #0b5; outline-offset: 3px; }
</style>
</head>
<body>
<label>
Search meetcode
<input type='search' name='q'>
</label>
</body>
</html>
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!