Shaded box 0021 (CSS3): box-shadow

Here Insert Picture Description

  • grammar:
box-shadow:水平阴影 垂直阴影 模糊距离(虚实)  阴影尺寸(影子大小)  阴影颜色  内/外阴影;

Here Insert Picture Description

  • The first two properties are to be written, the rest can be omitted.
  • h-shadow: when the value is positive, the shadow moves to the right, and vice versa, moves to the left.
  • v-shadow: when the value is positive, the shadow moves downward, whereas the upward movement.
  • blur: 0, is solid, the larger the value, the more fuzzy (i.e., the imaginary).
  • spread: controlling the size of the shadow, the larger the value, the larger the shadow, on the contrary, the smaller the shadow.
  • Outer shadow (outset) is the default, but they can not write the outset, in the shadow may want to write inset. [Generally] outer shadow
div {
            width: 200px;
            height: 200px;
            border: 10px solid red;
            /* box-shadow: 5px 5px 3px 4px rgba(0, 0, 0, .4);  */
            /* box-shadow:水平位置 垂直位置 模糊距离 阴影尺寸(影子大小) 阴影颜色  内/外阴影; */
            box-shadow: 0 15px 30px  rgba(0, 0, 0, .4);
            
}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        div {
            width: 200px;
            height: 200px;
            background-color: pink;
            margin: 50px auto;
            /*box-shadow:水平阴影 垂直阴影 模糊距离(虚实)  阴影尺寸(影子大小)  阴影颜色  内/外阴影;*/
            box-shadow: 0 15px 30px rgba(0,0,0,.3);
        }
    </style>
</head>
<body>
    <div></div>
</body>
</html>

Inner Shadow:
Here Insert Picture Description

Outer shadows:
Here Insert Picture Description

Guess you like

Origin www.cnblogs.com/jianjie/p/12125752.html