Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Вивчайте Interaction States | Section
Tailwind CSS for React Development

Interaction States

Свайпніть щоб показати меню

Tailwind provides utility classes to style elements based on user interaction.

Hover State

<button className="bg-blue-500 hover:bg-blue-700 text-white px-4 py-2 rounded">
  Hover me
</button>

hover:bg-blue-700: changes background on hover.

Focus State

<input className="border p-2 focus:border-blue-500 outline-none" />

focus:border-blue-500: changes border when focused.

Disabled State

<button className="bg-gray-400 text-white px-4 py-2 rounded disabled:opacity-50" disabled>
  Disabled
</button>

disabled:opacity-50: reduces opacity when disabled.

Use state prefixes like hover:, focus:, and disabled: to style interactive elements.

question mark

Which Tailwind CSS utility class changes an element's background color when a user hovers over it?

Виберіть правильну відповідь

Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 1. Розділ 8

Запитати АІ

expand

Запитати АІ

ChatGPT

Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат

Interaction States

Tailwind provides utility classes to style elements based on user interaction.

Hover State

<button className="bg-blue-500 hover:bg-blue-700 text-white px-4 py-2 rounded">
  Hover me
</button>

hover:bg-blue-700: changes background on hover.

Focus State

<input className="border p-2 focus:border-blue-500 outline-none" />

focus:border-blue-500: changes border when focused.

Disabled State

<button className="bg-gray-400 text-white px-4 py-2 rounded disabled:opacity-50" disabled>
  Disabled
</button>

disabled:opacity-50: reduces opacity when disabled.

Use state prefixes like hover:, focus:, and disabled: to style interactive elements.

Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 1. Розділ 8
some-alt