Friday, October 10, 2014

CSS Box Shadow

CSS Box Shadow

Basically you use this css:

div {
    box-shadow: 0px 20px 15px -15px rgba(0,0,0,0.49),  /* bottom */
                10px 0px 15px -15px rgba(0,0,0,0.49),  /* right */
                -10px 0px 15px -15px rgba(0,0,0,0.49); /* left */
    -webkit-box-shadow:  0px 20px 15px -15px rgba(0, 0, 0, 0.49),
                         10px 0px 15px -15px rgba(0,0,0,0.49),
                         -10px 0px 15px -15px rgba(0,0,0,0.49);
}

The 5 parameters are:

1. The horizontal offset of the shadow, positive means the shadow will be on the right of the box, a negative offset will put the shadow on the left of the box.
2. The vertical offset of the shadow, a negative one means the box-shadow will be above the box, a positive one means the shadow will be below the box.
3. The blur radius (optional), if set to 0 the shadow will be sharp, the higher the number, the more blurred it will be.
4. The spread radius (optional), positive values increase the size of the shadow, negative values decrease the size. Default is 0 (the shadow is same size as blur).
5. Color

No comments:

Blog Archive

Followers