doniyor
doniyor

Reputation: 37846

how to make div shadow only in belly part of box - css

I am trying to achieve this:

enter image description here

how is this possible in css? i saw some jsfiddle code but they seem to be pretty complex.

can someone pls help me?

Upvotes: 0

Views: 122

Answers (2)

Sobin Augustine
Sobin Augustine

Reputation: 3765

check out this pages, CSS drop-shadows without images Creating Different CSS3 Box Shadows Effects

This may help.

Upvotes: 1

Kiran
Kiran

Reputation: 20313

Try:

HTML CODE:

<div class="box effect">
    <h3>Effect</h3>
</div>

CSS CODE:

.box h3{
    text-align:center;
    position:relative;
    top:80px;
}
.box {
    width:70%;
    height:200px;
    background:#FFF;
    margin:40px auto;
}
.effect
{
    position:relative;       
    -webkit-box-shadow:0 1px 4px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.1) inset;
       -moz-box-shadow:0 1px 4px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.1) inset;
            box-shadow:0 1px 4px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.1) inset;
}
.effect:before, .effect:after
{
    content:"";
    position:absolute; 
    z-index:-1;
    -webkit-box-shadow:0 0 20px rgba(0,0,0,0.8);
    -moz-box-shadow:0 0 20px rgba(0,0,0,0.8);
    box-shadow:0 0 20px rgba(0,0,0,0.8);
    top:10px;
    bottom:10px;
    left:0;
    right:0;
    -moz-border-radius:100px / 10px;
    border-radius:100px / 10px;
} 
.effect:after
{
    right:10px; 
    left:auto;
    -webkit-transform:skew(8deg) rotate(3deg); 
       -moz-transform:skew(8deg) rotate(3deg);     
        -ms-transform:skew(8deg) rotate(3deg);     
         -o-transform:skew(8deg) rotate(3deg); 
            transform:skew(8deg) rotate(3deg);
}

DEMO FIDDLE

Upvotes: 4

Related Questions