Shadows
Bootstrap shadows / Material Design shadows
Note: This documentation is for an older version of Bootstrap (v.4). A
newer version is available for Bootstrap 5. We recommend migrating to the latest version of our product - Material Design for
Bootstrap 5.
Go to docs v.5
Bootstrap shadow is an effect used in web elements that provides important visual cues about objects' depth and directional movement.
They are the only visual cue indicating the amount of separation between surfaces. An object’s elevation determines the appearance of its shadow.
Creating shadows with MDB is very easy. You only need to add one of the shadow classes to the chosen element.
Examples
Add one of the following classes to any HTML element to achieve the desired depth of a shadow
.z-depth-1
.z-depth-1-half
.z-depth-2
.z-depth-3
.z-depth-4
.z-depth-5
<div class="example z-depth-5">
.z-depth-5
</div>
.z-depth-0
To remove an existing shadow from given element use the class
.z-depth-0
Shadow on hover
Add .hoverable
class to any element to easily apply the shadow hover effect.
hover on me!
<div class="example hoverable">
hover me!
</div>
Images with shadow
Add one of the following classes to image to achieve a desired depth of the shadow.
<!--Grid row-->
<div class="row my-4">
<!--Grid column-->
<div class="col-lg-4 col-md-12">
<img src="https://mdbootstrap.com/img/Photos/Others/images/81.webp" class="img-fluid z-depth-2 rounded" alt="First sample image">
</div>
<!--Grid column-->
<!--Grid column-->
<div class="col-lg-4 col-md-6">
<img src="https://mdbootstrap.com/img/Photos/Others/images/81.webp" class="img-fluid z-depth-3 rounded" alt="First sample image">
</div>
<!--Grid column-->
<!--Grid column-->
<div class="col-lg-4 col-md-6">
<img src="https://mdbootstrap.com/img/Photos/Others/images/81.webp" class="img-fluid z-depth-4 rounded" alt="First sample image">
</div>
<!--Grid column-->
</div>
<!--Grid row-->