Cisum Inas
Cisum Inas

Reputation: 12990

CSS Shadows only on bottom sides of div

How can I create shadows like this using CSS3: enter image description here

I have tried playing around with:

box-shadow: 6px 6px 6px -6px #919191;

Unfortunately it does not turn out the way I want it.

Upvotes: 0

Views: 56

Answers (1)

Ehsan
Ehsan

Reputation: 51

try this:

.box {
	width:70%;
	height:200px;
	background:#FFF;
	margin:40px auto;
}
.effect2
{
  position: relative;
}
.effect2:before, .effect2:after
{
  z-index: -1;
  position: absolute;
  content: "";
  bottom: 15px;
  left: 10px;
  width: 50%;
  top: 80%;
  max-width:300px;
  background: #777;
  -webkit-box-shadow: 0 15px 10px #777;
  -moz-box-shadow: 0 15px 10px #777;
  box-shadow: 0 15px 10px #777;
  -webkit-transform: rotate(-3deg);
  -moz-transform: rotate(-3deg);
  -o-transform: rotate(-3deg);
  -ms-transform: rotate(-3deg);
  transform: rotate(-3deg);
}
.effect2:after
{
  -webkit-transform: rotate(3deg);
  -moz-transform: rotate(3deg);
  -o-transform: rotate(3deg);
  -ms-transform: rotate(3deg);
  transform: rotate(3deg);
  right: 10px;
  left: auto;
}
<div class="box effect2"></div>

from [http://cssdeck.com/labs/different-css3-box-shadows-effects ][1]

Upvotes: 1

Related Questions