Tailwind CSS Transition Delay
Last Updated :
01 Aug, 2024
Improve
This class accepts lots of value in tailwind CSS in which all the properties are covered as in class form. The transition delay class is used to specify the length of time (in seconds or milliseconds) to start the transition effect. In CSS, we have done that by using the CSS transition-delay.
Transition Delay classes:
- delay-75: This class is used to start the transition time of 75ms.
- delay-100: This class is used to start the transition time of 100ms.
- delay-150: This class is used to start the transition time of 150ms.
- delay-200: This class is used to start the transition time of 200ms.
- delay-300: This class is used to start the transition time of 300ms.
- delay-500: This class is used to start the transition time of 500ms.
- delay-700: This class is used to start the transition time of 700ms.
- delay-1000: This class is used to start the transition time of 1000ms.
Syntax:
<element class="delay-{amount}">...</element>
Example:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Tailwind CSS Transition Delay Class</title>
<link href=
"https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css"
rel="stylesheet">
</head>
<body class="bg-gray-100 text-center
min-h-screen flex flex-col
items-center justify-center
space-y-6 p-4">
<h1 class="text-green-600 text-5xl font-bold mb-4">
GeeksforGeeks
</h1>
<b class="text-xl">Tailwind CSS Transition Delay Class</b>
<div class="bg-green-200 m-8
grid grid-cols-1
md:grid-cols-2
lg:grid-cols-4 gap-6
p-6 rounded-lg shadow-lg
border border-green-900">
<button class="transition delay-75
ease-in-out bg-green-300
hover:bg-green-600 transform
hover:-translate-y-1
hover:scale-110 rounded-lg p-4
border border-green-900">
Hover me
</button>
<button class="transition delay-100 ease-in-out
bg-green-300 hover:bg-green-600
transform hover:-translate-y-1
hover:scale-110 rounded-lg
p-4 border border-green-900">
Hover me
</button>
<button class="transition delay-500 ease-in-out
bg-green-300 hover:bg-green-600
transform hover:-translate-y-1
hover:scale-110 rounded-lg p-4
border border-green-900">
Hover me
</button>
<button class="transition delay-1000
ease-in-out bg-green-300
hover:bg-green-600 transform
hover:-translate-y-1 hover:scale-110
rounded-lg p-4 border border-green-900">
Hover me
</button>
</div>
</body>
</html>
Output: