0
0
Tailwindmarkup~20 mins

Form input patterns in Tailwind - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Form Input Patterns Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
selector
intermediate
1:30remaining
Identify the Tailwind selector for focused input border color
Which Tailwind CSS class applies a blue border only when an input field is focused?
Aactive:border-blue-500
Bhover:border-blue-500
Cfocus:border-blue-500
Dborder-blue-500
Attempts:
2 left
💡 Hint
Focus styles apply when the user clicks or tabs into the input.
layout
intermediate
1:30remaining
Arrange form inputs vertically with spacing using Tailwind
Given multiple input fields inside a form, which Tailwind utility class correctly arranges them vertically with consistent spacing?
Tailwind
<form class="?">
  <input type="text" placeholder="Name" />
  <input type="email" placeholder="Email" />
  <input type="password" placeholder="Password" />
</form>
Agrid grid-cols-3 gap-4
Bblock space-y-4
Cflex flex-row space-x-4
Dflex flex-col gap-4
Attempts:
2 left
💡 Hint
Vertical stacking with spacing uses flex column and gap utilities.
🧠 Conceptual
advanced
2:00remaining
Accessibility: Which attribute improves screen reader experience for form inputs?
Which HTML attribute should be added to an input element to ensure screen readers correctly announce its purpose?
Tailwind
<input type="text" ? />
Aaria-label="Full name"
Btabindex="-1"
Cspellcheck="false"
Dautocomplete="off"
Attempts:
2 left
💡 Hint
Screen readers rely on labels or aria-labels to describe inputs.
📝 Syntax
advanced
1:30remaining
Identify the correct Tailwind class for disabled input styling
Which Tailwind CSS class correctly styles an input with a gray background and cursor not-allowed when disabled?
Tailwind
<input type="text" disabled class="?" />
Abg-gray-200 disabled:cursor-not-allowed
Bdisabled:bg-gray-200 disabled:cursor-not-allowed
Cdisabled:bg-gray-200 cursor-not-allowed
Dbg-gray-200 cursor-not-allowed
Attempts:
2 left
💡 Hint
Use the 'disabled:' prefix to apply styles only when disabled.
rendering
expert
2:30remaining
What is the visual result of this Tailwind form input code?
Consider this input element:
<input type="text" placeholder="Username" class="border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-indigo-500 w-full max-w-sm" />

What will the user see when the input is focused?
Tailwind
<input type="text" placeholder="Username" class="border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-indigo-500 w-full max-w-sm" />
AA rounded input with gray border that shows a thick indigo ring around it on focus, full width up to a max width of small
BA square input with no border that turns red on focus and shrinks in width
CA rounded input with blue background and no border that expands width on focus
DAn input with thick black border and no focus effect
Attempts:
2 left
💡 Hint
Look for border, rounded, focus:ring, and width classes.