Home  >  Article  >  Web Front-end  >  CSS3的box-shadow

CSS3的box-shadow

高洛峰
高洛峰Original
2016-10-20 16:48:291547browse

Basic description:

Outer shadow: box-shadow: X axis Y axis Rpx color;

Property description (corresponding order): Shadow’s Shadow blur value (size) The color of the shadow

Inner shadow: box-shadow: Used for box models such as (div, p, h1, h2, h3, h4, h5, h6, etc.), not used to set text shadow If you set text shadow, please refer to the knowledge point: text-shadow (same principle)

Because it is new Attribute, in order to be compatible with major browsers and support lower versions of these major browsers, when using the box-shadow attribute on mainstream browsers, we need to write the name of the attribute in the form -webkit-box-shadow. Firefox browser needs to be written as-Moz-Box-SHADOW in the form

Oupeng browser-O-BOX-SHADOW IE> 9-BOX-SHADOW

Basic description:

For better understanding Box-Shadow for better understanding Box-Shadow Features, do a few small tests: (For the convenience of nesting styles directly within tags)

Test 1:

box-shadow: 0 0 10px #f00 (because the X-axis and Y-axis are not moved where the set values ​​are Will work on itself Radius range, color)

Test 2:

CSS3的box-shadow box-shadow: 4px 4px 10px #f00; Different from test 1, the X-axis and Y-axis changed positive values ​​(positive values ​​​​to the right and downwards ) So it became like this‍

Test 3:

CSS3的box-shadow box-shadow:-4px -4px 10px #f00;The difference from Test 2 is that the X-axis and Y-axis changed to negative values ​​(negative values ​​​​towards Left up) So it becomes like this‍

Similarly: you can test the effect of the next positive value and the next negative value, but I won’t do the test here. . . . . . . .

CSS3的box-shadowTest 4:

                                                                                                   " *Shadow below*/ >

Look This kind of code will feel very messy, but after seeing the effect picture, you will understand how it is done. All you have to do is change the X-axis and Y-axis positions, color values, and shadow value sizes (separated by commas) and practice more. Just a few times

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn