In this section we will see how to use box shadow color in tailwind css. we will see, shadow color adjust, custom shadow color , tailwind responsive shadow color, shadow color button, card with shadow color example with Tailwind CSS 3.
Example 1
Tailwind shadow color utilities with shadow-sm, shadow, shadow-md, shadow-lg, shadow-xl, or shadow-2xl .
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Tailwind CSS Box shadow color example </title>
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body>
<div class="flex flex-col items-center justify-center h-screen gap-4">
<div class="flex space-x-6">
<div class="p-6 shadow-md shadow-gray-500">shadow md color</div>
<div class="p-6 shadow-lg shadow-green-500">Shadow lg color</div>
<div class="p-6 shadow-xl shadow-red-500">Shadow xl color</div>
<div class="p-6 shadow-2xl shadow-purple-500">Shadow 2xl color</div>
</div>
</div>
</body>
</html>
Tailwind CSS Adjust shadow color.
<div class="p-6 shadow-md shadow-gray-500/50">shadow md color</div>
<div class="p-6 shadow-lg shadow-green-500/50">Shadow lg color</div>
<div class="p-6 shadow-xl shadow-red-500/40">Shadow xl color</div>
<div class="p-6 shadow-2xl shadow-purple-500/40">Shadow 2xl color</div>
Example 2
tailwind css shadow color hover effect
<div class="p-6 shadow-md hover:shadow-green-500/50">shadow hover color effect</div>
tailwind css responsive shadow color
<div class="p-6 shadow-lg shadow-green-500/40 lg:shadow-indigo-500/50">responsive shadow color</div>
Example 3
tailwind shadow color button.
<button class="px-6 py-2 text-purple-100 bg-purple-500 rounded shadow-xl shadow-purple-400/50 hover:shadow-purple-100">Shadow Color Button</button>
tailwind css card with shadow color.
<div class="flex space-x-6">
<div class="w-full p-6 bg-white border border-gray-200 rounded-lg shadow-md lg:max-w-md shadow-purple-500/50">
<h2 class="mb-2 text-2xl font-bold tracking-tight text-gray-900">Tailwind CSS Card with Shadow Color</h2>
<p class="mb-3 font-normal text-gray-700">Tailwind CSS Card with Shadow and Shadow Color</p>
<a href="#"
class="inline-flex items-center px-3 py-2 text-sm font-medium text-center text-white bg-purple-700 rounded-lg hover:bg-purple-800 focus:outline-none">
Read more
</a>
</div>
</div>
Example 4
tailwind css custome shadow color.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Tailwind CSS custom shadow color example </title>
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body>
<div class="flex flex-col items-center justify-center h-screen gap-4">
<div class="flex space-x-6">
<div class="p-6 shadow-lg shadow-[#50d71e]">custom shadow color</div>
<div class="p-6 shadow-lg shadow-[#e600e6]/40">custom shadow color</div>
</div>
</div>
</body>
</html>
Read Also
Tailwind CSS 3 FAQ Accordion UI Example
Tailwind CSS 3 Alert Message Example
Tailwind CSS 3 Avatars Example
Tailwind CSS 3 Breadcrumb Example
Tailwind CSS v3 Button Examples
Tailwind CSS Gradient Button Example
Tailwind CSS 3D Button Example
Tailwind CSS Loading Button Example
Tailwind CSS v3 Cards Examples
Tailwind CSS Checkbox Form Examples
Tailwind CSS Dropdowns (Menu) on Hover Example
Tailwind CSS Multiselect Dropdown Example
How to use dark mode toggle switch in Tailwind CSS 3
How to use @apply directive in Tailwind CSS
Tailwind CSS sticky header & fixed navbar example
Tailwind CSS Navbar UI Example
Tailwind CSS 3 Login Page UI Example
Tailwind CSS Login Modal Example
Tailwind CSS 3 Overlay Image Example
Tailwind CSS Thank You Page Example
Tailwind CSS Timeline UI Example
Tailwind CSS Responsive Footer Section Example
Tailwind CSS Background Image Header Example