Focus Ring with Outline Offset

Focus Ring with Outline Offset

Medium CSS Box Model & Sizing 17 views
Explanation Complexity

Problem Statement

Make an input focus ring that has space using outline-offset.

Input Format

No input.

Output Format

Print the HTML+CSS code in one block.

Constraints

Use :focus-visible and outline-offset.

Input / Output Format

Input Format
No input.
Output Format
Print the HTML+CSS code in one block.
Constraints
Use :focus-visible and outline-offset.

Examples

Input:
Output:
(HTML+CSS code)

Example Solution (Public)

CSS
<!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>

Official Solution Code

<!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>
Please login to submit solutions.
Editor
Output

                                        
Please login to submit solutions.