Box-shadow Property

Source: Internet
Author: User

I. Definition and usage

The Box-shadow property adds one or more shadows to the box.

second, the grammar
Box-shadow:h-shadow v-shadow blur spread color inset;
H-shadow Necessary. The position of the horizontal shadow. Negative values are allowed.
V-shadow Necessary. The position of the vertical shadow. Negative values are allowed.
Blur Optional. Blur distance.
Spread Optional. The size of the shadow.
Color Optional. The color of the shadow.
Inset Optional. Changes the outer shadow (outset) to an inner shadow.









Iii. examples

1. box-shadow:2px 3px 4px #CCC;

/*<div style= "box-shadow:2px 3px 4px #CCC; width:300px;height:25px;margin:50px;border:2px solid #9CF;" > Blog Park </div>*/

An outer shadow element, the shadow position x-axis to the right offset 2px,y axis downward offset 3px, blur range 4px, shadow color #ccc

2. Box-shadow:inset 0-4px #CCC;

element with inner shadow, shadow X axis not offset, y upward offset 4px, color #ccc

3. Differences

1) Inner Shadow and outer shadow

Horizontal value positive: offset to the right. The outer shadow is shifted to the right, the shadow is right, the inner shadow is shifted to the right, and the shadow is left.

Negative value: Offset to the left. The outer shadow shifts left, the shadow is left, the inner shadow shifts to the left, and the shadow is on the right.

Vertical value positive: offset downward. The outer shadow is shifted downward, the shadow is down, the inner shadow is shifted downward, and the shadow is on.

Negative value: offset upward. The outer shadow is offset upward, the shadow is on top, the inner shadow is offset upward, and the shadow is down.

2) Shadow position size

3) Blur distance

"0" means that there is no blur effect is the most clear, the greater the more blurred, reached a certain value is a fog

4) Shadow Size



Box-shadow Property

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.