0
0
Tailwindmarkup~10 mins

Form input patterns 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 rounded border to the input field using Tailwind CSS.

Tailwind
<input type="text" class="border [1] p-2" placeholder="Enter your name">
Drag options to blanks, or click blank then click option'
Abg-blue-500
Bshadow-md
Ctext-center
Drounded-lg
Attempts:
3 left
💡 Hint
Common Mistakes
Using background color classes instead of border shape classes.
Forgetting to include the border class itself.
2fill in blank
medium

Complete the code to make the input field full width and add padding inside it.

Tailwind
<input type="email" class="[1] p-3 border rounded" placeholder="Email address">
Drag options to blanks, or click blank then click option'
Aw-full
Bw-1/2
Ch-full
Dmax-w-xs
Attempts:
3 left
💡 Hint
Common Mistakes
Using height classes instead of width classes.
Using fractional widths that don't fill the container.
3fill in blank
hard

Fix the error in the code to add a blue border on focus for the input field.

Tailwind
<input type="password" class="border rounded p-2 focus:[1]" placeholder="Password">
Drag options to blanks, or click blank then click option'
Aborder-blue-500
Bbg-blue-500
Ctext-blue-500
Dborder-red-500
Attempts:
3 left
💡 Hint
Common Mistakes
Using background color classes instead of border color classes.
Forgetting the focus: prefix.
4fill in blank
hard

Fill both blanks to create a textarea with a gray background and padding.

Tailwind
<textarea class="[1] [2] border rounded" placeholder="Your message"></textarea>
Drag options to blanks, or click blank then click option'
Abg-gray-100
Bp-4
Ctext-lg
Dm-2
Attempts:
3 left
💡 Hint
Common Mistakes
Using margin classes instead of padding.
Using text size classes instead of background color.
5fill in blank
hard

Fill all three blanks to create a submit button with green background, white text, and rounded corners.

Tailwind
<button class="[1] [2] [3] font-bold py-2 px-4">Submit</button>
Drag options to blanks, or click blank then click option'
Abg-green-500
Btext-white
Crounded
Dborder
Attempts:
3 left
💡 Hint
Common Mistakes
Using border class instead of rounded for corners.
Forgetting to set text color for contrast.