Tailwind CSS shadow-md Class
The shadow-md utility class generates the following CSS when applied to an element.
CSS Output
.shadow-md {
box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}Variants
Use these variant prefixes to apply shadow-md conditionally:
Use It
<div class="shadow-md rounded-lg bg-white p-6">
Elevated card with medium shadow
</div>Understanding shadow-md
The Tailwind CSS shadow-md utility applies box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); to an element when added to its class attribute. It applies a medium box shadow with noticeable depth. Great for dropdown menus, popovers, and cards that need clear elevation from the background.
This utility is part of Tailwind's Effects module, designed for applying visual effects including shadows, opacity, rings, and blur filters to elements. In Tailwind's utility-first workflow, you add shadow-md directly to your HTML elements rather than writing custom CSS. This approach accelerates development and keeps styles co-located with your markup, making it easy to see exactly how each element is styled at a glance.
Common responsive variants include sm:shadow-md, md:shadow-md, lg:shadow-md, and xl:shadow-md, allowing different behavior at each breakpoint. State variants like hover:shadow-md and focus:shadow-md enable interactive styling without any JavaScript. You can also combine multiple variants for fine-grained control over when the utility applies.
This class works well alongside `shadow`, `shadow-lg`, `shadow-sm`, `rounded-lg` to build complete, production-ready interfaces. Tailwind's tree-shaking ensures only utilities you actually use appear in your final CSS bundle, keeping file sizes minimal. Browser support for the underlying CSS is excellent across Chrome, Firefox, Safari, and Edge.
Related Classes
Explore More Tailwind Classes
Browse our complete reference of 321 Tailwind CSS utility classes with CSS output, variants, and examples.