Sling Academy
Home/Tailwind CSS/Text Shadows in Tailwind CSS

Text Shadows in Tailwind CSS

Last updated: December 15, 2023

In recent versions of Tailwind CSS, you can add drop shadows to text by using the drop-shadow-{amount} utilities (you can also use these classes for div elements to create box shadows). {amount} can be one of the following:

  • md: Medium
  • lg: Large
  • xl: Extra large
  • 2xl: Double extra large

To set the colors of shadows, you can use shadow-{color} utility classes.

Example

Screenshot:

The code:

<body>
    <div class="m-20">
        <h1 class="text-7xl font-extrabold text-amber-300 drop-shadow-lg ">Hello World</h1>
        <h1 class="text-7xl font-extrabold text-blue-600 drop-shadow-md shadow-blue-600/50">Sling Academy</h1>
        <h1 class="text-7xl font-bold text-white drop-shadow-lg shadow-black">Tailwind Is Awesome</h1>
    </div>
</body>

That’s it. Happy coding & have fun with Tailwind CSS!

Next Article: How to Create Frosted Glass Effect in Tailwind CSS

Previous Article: Styling Figure & Figcaption with Tailwind CSS

Series: Styling Text & Images with Tailwind CSS

Tailwind CSS

Related Articles

You May Also Like

  • How to Zoom on Hover with Tailwind CSS (the easiest approach)
  • Using :not() selector in Tailwind CSS
  • Tailwind CSS: How to Create a Stepper
  • Using ::before and ::after in Tailwind CSS
  • Tailwind CSS: How to Create a Vertical Divider Line
  • How to Create Pill Buttons with Tailwind CSS
  • Tailwind CSS: How to Disable Text Selection
  • Tailwind CSS: How to Disable Resizing of Textarea
  • Tailwind CSS: Create a Floating Action Button (FAB)
  • Tailwind CSS: How to style the Select element
  • Tailwind CSS: Expand a Text Input on Focus (without Javascript)
  • Tailwind CSS: Create Image Hover Overlay Effects
  • How to Disable a Link with Tailwind CSS
  • How to Create a Hero Image with Tailwind CSS
  • Tailwind CSS: How to place text over an image
  • How to Create Frosted Glass Effect in Tailwind CSS
  • Styling Figure & Figcaption with Tailwind CSS
  • Tailwind CSS: How to Create Blurred Background Image
  • Tailwind CSS: Red Notification Badge with a Count