Tailwind CSS challenges

Practice problem statements with input format, output format, constraints and solutions.

beginner

Tailwind Introduction challenge

Build a small solution that uses Tailwind Introduction in Tailwind CSS and handles one normal case plus one edge case.

Input format

Use a short text value, array, query, or sample object depending on the topic.

Output format

Print, render, or return the processed result in a readable format.

Constraints

  • Keep the solution under 60 lines.
  • Use descriptive names.
  • Do not depend on hidden external services.

Starter code

<div className="p-6 max-w-sm mx-auto bg-white rounded-xl shadow-md flex items-center space-x-4">
  <div><div className="text-xl font-medium text-black">Tailwind Introduction</div><p className="text-slate-500">Tailwind CSS utility utility card.</p></div>
</div>

Test cases

  • basic sample - valid processed result
  • empty or small sample - safe fallback result

Hint

Focus on the core tailwind introduction pattern before polishing the final output.

Solution

<div className="p-6 max-w-sm mx-auto bg-white rounded-xl shadow-md flex items-center space-x-4">
  <div><div className="text-xl font-medium text-black">Tailwind Introduction solution</div><p className="text-slate-500">Tailwind CSS utility utility card.</p></div>
</div>
beginner

Tailwind Setup challenge

Build a small solution that uses Tailwind Setup in Tailwind CSS and handles one normal case plus one edge case.

Input format

Use a short text value, array, query, or sample object depending on the topic.

Output format

Print, render, or return the processed result in a readable format.

Constraints

  • Keep the solution under 60 lines.
  • Use descriptive names.
  • Do not depend on hidden external services.

Starter code

<div className="p-6 max-w-sm mx-auto bg-white rounded-xl shadow-md flex items-center space-x-4">
  <div><div className="text-xl font-medium text-black">Tailwind Setup</div><p className="text-slate-500">Tailwind CSS utility utility card.</p></div>
</div>

Test cases

  • basic sample - valid processed result
  • empty or small sample - safe fallback result

Hint

Focus on the core tailwind setup pattern before polishing the final output.

Solution

<div className="p-6 max-w-sm mx-auto bg-white rounded-xl shadow-md flex items-center space-x-4">
  <div><div className="text-xl font-medium text-black">Tailwind Setup solution</div><p className="text-slate-500">Tailwind CSS utility utility card.</p></div>
</div>
beginner

Utility First Concept challenge

Build a small solution that uses Utility First Concept in Tailwind CSS and handles one normal case plus one edge case.

Input format

Use a short text value, array, query, or sample object depending on the topic.

Output format

Print, render, or return the processed result in a readable format.

Constraints

  • Keep the solution under 60 lines.
  • Use descriptive names.
  • Do not depend on hidden external services.

Starter code

<div className="p-6 max-w-sm mx-auto bg-white rounded-xl shadow-md flex items-center space-x-4">
  <div><div className="text-xl font-medium text-black">Utility First Concept</div><p className="text-slate-500">Tailwind CSS utility utility card.</p></div>
</div>

Test cases

  • basic sample - valid processed result
  • empty or small sample - safe fallback result

Hint

Focus on the core utility first concept pattern before polishing the final output.

Solution

<div className="p-6 max-w-sm mx-auto bg-white rounded-xl shadow-md flex items-center space-x-4">
  <div><div className="text-xl font-medium text-black">Utility First Concept solution</div><p className="text-slate-500">Tailwind CSS utility utility card.</p></div>
</div>
beginner

Typography Utilities challenge

Build a small solution that uses Typography Utilities in Tailwind CSS and handles one normal case plus one edge case.

Input format

Use a short text value, array, query, or sample object depending on the topic.

Output format

Print, render, or return the processed result in a readable format.

Constraints

  • Keep the solution under 60 lines.
  • Use descriptive names.
  • Do not depend on hidden external services.

Starter code

<div className="p-6 max-w-sm mx-auto bg-white rounded-xl shadow-md flex items-center space-x-4">
  <div><div className="text-xl font-medium text-black">Typography Utilities</div><p className="text-slate-500">Tailwind CSS utility utility card.</p></div>
</div>

Test cases

  • basic sample - valid processed result
  • empty or small sample - safe fallback result

Hint

Focus on the core typography utilities pattern before polishing the final output.

Solution

<div className="p-6 max-w-sm mx-auto bg-white rounded-xl shadow-md flex items-center space-x-4">
  <div><div className="text-xl font-medium text-black">Typography Utilities solution</div><p className="text-slate-500">Tailwind CSS utility utility card.</p></div>
</div>
beginner

Spacing Padding Margin challenge

Build a small solution that uses Spacing Padding Margin in Tailwind CSS and handles one normal case plus one edge case.

Input format

Use a short text value, array, query, or sample object depending on the topic.

Output format

Print, render, or return the processed result in a readable format.

Constraints

  • Keep the solution under 60 lines.
  • Use descriptive names.
  • Do not depend on hidden external services.

Starter code

<div className="p-6 max-w-sm mx-auto bg-white rounded-xl shadow-md flex items-center space-x-4">
  <div><div className="text-xl font-medium text-black">Spacing Padding Margin</div><p className="text-slate-500">Tailwind CSS utility utility card.</p></div>
</div>

Test cases

  • basic sample - valid processed result
  • empty or small sample - safe fallback result

Hint

Focus on the core spacing padding margin pattern before polishing the final output.

Solution

<div className="p-6 max-w-sm mx-auto bg-white rounded-xl shadow-md flex items-center space-x-4">
  <div><div className="text-xl font-medium text-black">Spacing Padding Margin solution</div><p className="text-slate-500">Tailwind CSS utility utility card.</p></div>
</div>
beginner

Colors and Borders challenge

Build a small solution that uses Colors and Borders in Tailwind CSS and handles one normal case plus one edge case.

Input format

Use a short text value, array, query, or sample object depending on the topic.

Output format

Print, render, or return the processed result in a readable format.

Constraints

  • Keep the solution under 60 lines.
  • Use descriptive names.
  • Do not depend on hidden external services.

Starter code

<div className="p-6 max-w-sm mx-auto bg-white rounded-xl shadow-md flex items-center space-x-4">
  <div><div className="text-xl font-medium text-black">Colors and Borders</div><p className="text-slate-500">Tailwind CSS utility utility card.</p></div>
</div>

Test cases

  • basic sample - valid processed result
  • empty or small sample - safe fallback result

Hint

Focus on the core colors and borders pattern before polishing the final output.

Solution

<div className="p-6 max-w-sm mx-auto bg-white rounded-xl shadow-md flex items-center space-x-4">
  <div><div className="text-xl font-medium text-black">Colors and Borders solution</div><p className="text-slate-500">Tailwind CSS utility utility card.</p></div>
</div>
beginner

Sizing Width Height challenge

Build a small solution that uses Sizing Width Height in Tailwind CSS and handles one normal case plus one edge case.

Input format

Use a short text value, array, query, or sample object depending on the topic.

Output format

Print, render, or return the processed result in a readable format.

Constraints

  • Keep the solution under 60 lines.
  • Use descriptive names.
  • Do not depend on hidden external services.

Starter code

<div className="p-6 max-w-sm mx-auto bg-white rounded-xl shadow-md flex items-center space-x-4">
  <div><div className="text-xl font-medium text-black">Sizing Width Height</div><p className="text-slate-500">Tailwind CSS utility utility card.</p></div>
</div>

Test cases

  • basic sample - valid processed result
  • empty or small sample - safe fallback result

Hint

Focus on the core sizing width height pattern before polishing the final output.

Solution

<div className="p-6 max-w-sm mx-auto bg-white rounded-xl shadow-md flex items-center space-x-4">
  <div><div className="text-xl font-medium text-black">Sizing Width Height solution</div><p className="text-slate-500">Tailwind CSS utility utility card.</p></div>
</div>
beginner

Flexbox Utilities challenge

Build a small solution that uses Flexbox Utilities in Tailwind CSS and handles one normal case plus one edge case.

Input format

Use a short text value, array, query, or sample object depending on the topic.

Output format

Print, render, or return the processed result in a readable format.

Constraints

  • Keep the solution under 60 lines.
  • Use descriptive names.
  • Do not depend on hidden external services.

Starter code

<div className="grid grid-cols-1 md:grid-cols-3 gap-6 p-6 bg-slate-50 rounded-2xl">
  <div className="bg-white p-4 shadow-sm border border-slate-100 rounded-xl hover:-translate-y-1 transition duration-300">Stat Card 1</div>
</div>

Test cases

  • basic sample - valid processed result
  • empty or small sample - safe fallback result

Hint

Focus on the core flexbox utilities pattern before polishing the final output.

Solution

<div className="grid grid-cols-1 md:grid-cols-3 gap-6 p-6 bg-slate-50 rounded-2xl">
  <div className="bg-white p-4 shadow-sm border border-slate-100 rounded-xl hover:-translate-y-1 transition duration-300">Stat Card 1</div>
</div>
beginner

Grid Utilities challenge

Build a small solution that uses Grid Utilities in Tailwind CSS and handles one normal case plus one edge case.

Input format

Use a short text value, array, query, or sample object depending on the topic.

Output format

Print, render, or return the processed result in a readable format.

Constraints

  • Keep the solution under 60 lines.
  • Use descriptive names.
  • Do not depend on hidden external services.

Starter code

<div className="grid grid-cols-1 md:grid-cols-3 gap-6 p-6 bg-slate-50 rounded-2xl">
  <div className="bg-white p-4 shadow-sm border border-slate-100 rounded-xl hover:-translate-y-1 transition duration-300">Stat Card 1</div>
</div>

Test cases

  • basic sample - valid processed result
  • empty or small sample - safe fallback result

Hint

Focus on the core grid utilities pattern before polishing the final output.

Solution

<div className="grid grid-cols-1 md:grid-cols-3 gap-6 p-6 bg-slate-50 rounded-2xl">
  <div className="bg-white p-4 shadow-sm border border-slate-100 rounded-xl hover:-translate-y-1 transition duration-300">Stat Card 1</div>
</div>
beginner

Layout and Position challenge

Build a small solution that uses Layout and Position in Tailwind CSS and handles one normal case plus one edge case.

Input format

Use a short text value, array, query, or sample object depending on the topic.

Output format

Print, render, or return the processed result in a readable format.

Constraints

  • Keep the solution under 60 lines.
  • Use descriptive names.
  • Do not depend on hidden external services.

Starter code

<div className="p-6 max-w-sm mx-auto bg-white rounded-xl shadow-md flex items-center space-x-4">
  <div><div className="text-xl font-medium text-black">Layout and Position</div><p className="text-slate-500">Tailwind CSS utility utility card.</p></div>
</div>

Test cases

  • basic sample - valid processed result
  • empty or small sample - safe fallback result

Hint

Focus on the core layout and position pattern before polishing the final output.

Solution

<div className="p-6 max-w-sm mx-auto bg-white rounded-xl shadow-md flex items-center space-x-4">
  <div><div className="text-xl font-medium text-black">Layout and Position solution</div><p className="text-slate-500">Tailwind CSS utility utility card.</p></div>
</div>