×

Tailwind CSS Box Shadow

The Tailwind CSS Box Shadow class accepts a lot of value, and all of the properties are covered in class form. We may control the box-shadow of an element by using this class. We implement this in CSS by using the box-shadow CSS Shadow Effect attributes.

Box Shadow Classes

The various box shadow classes are as follows:

  • shadow-sm: This class is intended to make the box have a faded or small shadow effect.
  • shadow: This class is used to provide the box with a regular shadow effect.
  • shadow-md: The box md effects are created with this class.
  • shadow-lg: This class is used to create a large shadow effect for the box.
  • shadow-xl: This class creates an xl shadow effect for the box.
  • shadow-2xl: This class creates a 2xl shadow effect for the box.
  • shadow-inner: This class is used to create shadows on the box's inside.
  • shadow-none: The shadow effects are diluted using this class.

Syntax is:

<element class="shadow-{shadow-depth}">...</element>

Example

Code is as follows:

<!DOCTYPE html>
<head>
    <link href=
"https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css"
        rel="stylesheet">
</head>
<body class="text-center mx-4 space-y-2">
    <h1 class="text-red-600 text-5xl font-bold">
        Tutorial and Example
    </h1>
    <b>Box Shadow Class - Tailwind CSS </b>
    <div class="grid grid-flow-col text-center p-2">
        <div class="shadow-sm w-24 h-24 bg-red-200
                    rounded-lg">shadow-sm
        </div>
        <div class="shadow w-24 h-24 bg-red-200
                    rounded-lg">shadow
        </div>
        <div class="shadow-md w-24 h-24 bg-red-200
                    rounded-lg">shadow-md
        </div>
        <div class="shadow-lg w-24 h-24 bg-red-200
                    rounded-lg">shadow-lg
        </div>
        <div class="shadow-xl w-24 h-24 bg-red-200
                    rounded-lg">shadow-xl
        </div>
        <div class="shadow-2xl w-24 h-24 bg-red-200
                    rounded-lg">shadow-2xl
        </div>
    </div>
</body>
</html>

Output:

Tailwind CSS Box Shadow

Related Topics

Tailwind CSS Box Shadow

The Tailwind CSS Box Shadow class accepts a lot of value, and all of the properties are covered in class form. We may control the box-shadow of an element by...

2 minutes read.

Tailwind CSS Place Self

The tailwind CSS Place self class accepts a wide range of values. It's a replacement for the CSS Place Items property. This class is used to manage how a single...

4 minutes read.

Tailwind CSS Fill

The CSS Fill class accepts a lot of value, and all of the properties are covered in class form. It is a presentation attribute that controls how an SVG shape's...

1 minute read.

Tailwind CSS Grid Template Rows

In tailwind CSS, this class accepts multiple values and all properties are covered in class form. It's the CSS grid-template-row property's replacement. It is used to set the number of...

2 minutes read.

Tailwind CSS Min-Height

In tailwind CSS, this class accepts a large number of values, and all of the properties are covered in class form. It's a replacement for the CSS Min-Height Property. It...

2 minutes read.

Tailwind CSS Z-index

The tailwind CSS framework is a CSS utility framework that provides classes for managing HTML content with CSS. Tailwind CSS simplifies our design process and makes it responsive across numerous...

4 minutes read.

Tailwind CSS Visibility

In tailwind CSS, this class accepts two values. It's a replacement for the CSS visibility property. This class specifies whether an element in a web document is visible or not,...

2 minutes read.

Tailwind CSS Place Content

This class accepts a wide range of values. It's a replacement for the CSS Place Content property. This class is used to manage how information is justified while still being...

5 minutes read.

Tailwind CSS Order

One of the best features of Tailwind CSS is the Order class, which allows us to order flex and grid objects according to our needs. There are several different order...

2 minutes read.

Tailwind CSS Object Fit

It acknowledges more than one value in tailwind CSS. Every one of its properties is covered as in class form. It is the option in contrast to the CSS object-fit...

4 minutes read.

Tailwind CSS Top / Right / Bottom / Left

In tailwind CSS, these classes take a variety of values and cover all of the characteristics in the class form. These are the CSS Top/Right/Bottom/Left properties' replacements. These classes are...

4 minutes read.

Tailwind CSS Flex Grow

CSS flexbox is an important element for frontend development; there are two flex-grow options in Tailwind CSS, and all attributes are covered in class form. It is an alternative to...

3 minutes read.

Tailwind CSS Margin

The margin class accepts a large number of values, and all of the properties are covered in the same way they are in the class form. It's a replacement for...

6 minutes read.

Tailwind CSS Min-Width

In tailwind CSS, this class accepts a large number of values, and all of the properties are covered in class form. It's a replacement for the CSS min-width property. This...

1 minute read.

Tailwind CSS Align Items

In tailwind CSS, this class accepts a wide range of values. It's a replacement for the CSS Align Items attribute. This class is used to align things within the flexible...

5 minutes read.

Tailwind CSS Object Position

It acknowledges more than one value in tailwind CSS. Every one of the properties is covered as in class form. It is the option in contrast to the CSS object-position...

2 minutes read.

Tailwind CSS Max-Height

This class accepts a large number of values, and all of the properties are covered in class form. It's a replacement for the CSS Max-Height attribute. It is used to...

3 minutes read.

Tailwind CSS Display

It acknowledges more than one worth in tailwind CSS. Every one of the properties is shrouded as in class structure. It is an option in contrast to the CSS display...

5 minutes read.

Tailwind CSS Container

In Tailwind CSS, a compartment is utilized to fix the maximum width (max-width) of a component to match the min-width of the breakpoint. It comes exceptionally convenient when content must...

2 minutes read.

Tailwind CSS Flex Wrap

CSS flexbox is an important component for frontend development. It is a front-end development alternative to the CSS flex-wrap Property. Note: You must include the flex class in your element before...

4 minutes read.