Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

css3 arrow with drop shadow

css3 arrow with drop shadow

Problem

Hey currently I have this css to produce a css Arrow but I cannot seem to get a drop shadow on it any ideas

.arrow {
    width: 0px;
    height: 0px;
    border-style: solid inset;
    border-width: 10px 78px 0 78px;
    border-color: #000 transparent transparent transparent;
    z-index: 1;
}

I have dabbled with :after and :before but with no success

Problem courtesy of: Johan Rheeder

Solution

Since your arrow is going to be placed under a solid rectangle, this can help you

.demo {
    position: absolute;
    top: 50px;
    left: 0px;
    width: 200px;
    height: 50px;
    clip: rect(0px 400px 100px 0px);    
}
.demo:after {
    content: "";
    position: absolute;
    top: 0px;
    left: 0px;
    width: 100%;
    height: 100%;
    background-color: black;
    -webkit-transform: translate(-90px, -45px) skew(80deg) rotate(-5deg);
    -moz-transform: translate(-90px, -45px) skew(80deg) rotate(-5deg);
    transform: translate(-90px, -45px) skew(80deg) rotate(-5deg);
    box-shadow: 30px 1px 6px blue;
}

fiddle compared with your original arrow

The problem is that the shadow can not go upwards, but usually this design wouldn't need that anyway.

Also, the base div is highly distorted, so you will need to set the shadow by trial and error.

Solution courtesy of: vals

Discussion

View additional discussion.



This post first appeared on CSS3 Recipes - The Solution To All Your Style Problems, please read the originial post: here

Share the post

css3 arrow with drop shadow

×

Subscribe to Css3 Recipes - The Solution To All Your Style Problems

Get updates delivered right to your inbox!

Thank you for your subscription

×