Bootstrap snippet and html example. Box shadow effect

Bootstrap 3.3.6 snippet "Box shadow effect" with HTML, CSS, and JS. Copy, paste, and customize this responsive UI component for your project.
Tags: div,box,shadow

HTML code

Clean, semantic HTML that powers this Bootstrap 3.3.6 snippet. Copy and paste it into your page (with Bootstrap loaded) to reproduce the exact layout shown in the preview.

<div class="container bootstrap snippets bootdeys">
    <div class="row">
        <div class="col-sm-2 text-center">
    		<p>Without shadow</p>
    		<div class="box-shadow-demo"></div>
    	</div>
    	<div class="col-sm-2 text-center">
    		<p>.z-depth-1</p>
    		<div class="box-shadow-demo z-depth-1"></div>
    	</div>
    	<div class="col-sm-2 text-center">
    		<p>.z-depth-2</p>
    		<div class="box-shadow-demo z-depth-2"></div>
    	</div>
    	<div class="col-sm-2 text-center">
    		<p>.z-depth-3</p>
    		<div class="box-shadow-demo z-depth-3"></div>
    	</div>
    	<div class="col-sm-2 text-center">
    		<p>.z-depth-4</p>
    		<div class="box-shadow-demo z-depth-4"></div>
    	</div>
    	<div class="col-sm-2 text-center">
    		<p>.z-depth-5</p>
    		<div class="box-shadow-demo z-depth-5"></div>
    	</div>
    </div>
</div>

CSS code

Scoped CSS that styles the component. Paste it after Bootstrap 3.3.6 to keep the design, spacing, and responsiveness consistent.

body{margin-top:20px;}

.box-shadow-demo {
    background-color: #009688;
    height: 100px;
    width: 100px;
    margin: 20px auto;
}
.z-depth-1 {
    -webkit-box-shadow: 0 1px 4px 0 rgba(0,0,0,0.37);
    box-shadow: 0 1px 4px 0 rgba(0,0,0,0.37);
}
.z-depth-2 {
    -webkit-box-shadow: 0 2px 2px 0 rgba(0,0,0,0.2),0 6px 10px 0 rgba(0,0,0,0.3);
    box-shadow: 0 2px 2px 0 rgba(0,0,0,0.2),0 6px 10px 0 rgba(0,0,0,0.3);
}
.z-depth-3 {
    -webkit-box-shadow: 0 11px 7px 0 rgba(0,0,0,0.19),0 13px 25px 0 rgba(0,0,0,0.3);
    box-shadow: 0 11px 7px 0 rgba(0,0,0,0.19),0 13px 25px 0 rgba(0,0,0,0.3);
}
.z-depth-4 {
    -webkit-box-shadow: 0 14px 12px 0 rgba(0,0,0,0.17),0 20px 40px 0 rgba(0,0,0,0.3);
    box-shadow: 0 14px 12px 0 rgba(0,0,0,0.17),0 20px 40px 0 rgba(0,0,0,0.3);
}
.z-depth-5 {
    -webkit-box-shadow: 0 17px 17px 0 rgba(0,0,0,0.15),0 27px 55px 0 rgba(0,0,0,0.3);
    box-shadow: 0 17px 17px 0 rgba(0,0,0,0.15),0 27px 55px 0 rgba(0,0,0,0.3);
}

Similar snippets

Bootstrap example and template. bs4 image box

bs4 image box

Bootstrap example and template. box funny

box funny

Bootstrap example and template. login box

login box

Bootstrap example and template. div ribbons

div ribbons

Bootstrap example and template. bs5 dark footer

bs5 dark footer

Bootstrap example and template. social User Profile and layout

social User Profile and layout

Bootstrap example and template. Form register inside narrow jumbotron

Form register inside narrow jumbotron

Bootstrap example and template. Simple 404 error page

Simple 404 error page

FAQ

How do I use this snippet?

Include Bootstrap 3.3.6, paste the HTML, add the CSS block, and include the JS (if any) to mirror the live preview.

Can I use it in commercial projects?

Yes. It’s free for personal and commercial work; check the snippets license for details.

Is it responsive?

Yes. It inherits the responsive grid and components from Bootstrap 3.3.6.

Bootstrap example and template. Box shadow effect

About this bootstrap example/template

Optimized for copy‑paste: clean HTML, scoped CSS, and minimal JS so you can ship production‑ready UI faster and keep designs consistent.

Mobile‑first and responsive by default. Tested across modern browsers to reduce polish time on your project.

Already trusted in 11.7K+ views. Reuse this snippet to speed up landing pages, dashboards, or onboarding flows.

Bootstrap 3.3.6

<link rel='stylesheet' href='https://netdna.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css'>

<script src='https://netdna.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js'></script>

This code example is based on bootstrap 3.3.6 and the grid system of this framework

Responsive

Based on bootstrap framework makes all the layouts perfectly responsive for all devices

Crossbrowser compatibility

Tested on all major browsers, it works smoothly on all of them

semantic html 5

Built on html / css3 the code quality is really amazing

Simple Integration

This code example can be simply integrated on existing sites and new ones too, all you need to do is copy the code and start working