0
0
Tailwindmarkup~10 mins

Ring utilities for focus states in Tailwind - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to add a blue ring around the button when it is focused.

Tailwind
<button class="focus:ring-4 focus:ring-[1]-500 focus:outline-none">Click me</button>
Drag options to blanks, or click blank then click option'
Agreen
Bblue
Cred
Dyellow
Attempts:
3 left
💡 Hint
Common Mistakes
Using a color that is not a valid Tailwind color.
Forgetting to add focus: prefix.
2fill in blank
medium

Complete the code to remove the default outline and add a green ring on focus.

Tailwind
<input type="text" class="focus:ring-2 focus:ring-[1]-500 focus:outline-none" placeholder="Enter text">
Drag options to blanks, or click blank then click option'
Agreen
Bred
Cblue
Dpurple
Attempts:
3 left
💡 Hint
Common Mistakes
Not removing the default outline, so both outline and ring appear.
Using a ring width other than 2.
3fill in blank
hard

Fix the error in the code to correctly apply a red ring on focus with width 3.

Tailwind
<textarea class="focus:ring-[1] focus:ring-red-500 focus:outline-none"></textarea>
Drag options to blanks, or click blank then click option'
A3
B4
C2
D5
Attempts:
3 left
💡 Hint
Common Mistakes
Using the color number as ring width.
Mixing ring width and color classes incorrectly.
4fill in blank
hard

Fill both blanks to create a button with a yellow ring of width 6 on focus and no default outline.

Tailwind
<button class="focus:ring-[2] focus:ring-[1]-500 focus:outline-none">Submit</button>
Drag options to blanks, or click blank then click option'
Ayellow
Bblue
C6
D4
Attempts:
3 left
💡 Hint
Common Mistakes
Using a ring width that is too small or not supported.
Forgetting to remove the default outline.
5fill in blank
hard

Fill all three blanks to create an input with a purple ring of width 4 on focus, no outline, and a smooth transition.

Tailwind
<input type="text" class="focus:ring-[2] focus:ring-[1]-500 focus:outline-[3] transition duration-300" placeholder="Name">
Drag options to blanks, or click blank then click option'
Apurple
B4
Cnone
Dblue
Attempts:
3 left
💡 Hint
Common Mistakes
Using an incorrect ring width number.
Not removing the outline properly.
Forgetting the transition classes.