What does box-shadow mean in css3

青灯夜游
Release: 2022-02-28 16:50:15
Original
6726 people have browsed it

In CSS3, "box-shadow" means "box shadow", which is a new attribute that adds border shadow to elements; this attribute can add one or more shadows to the box, the syntax "box -shadow: horizontal shadow vertical shadow blur distance size color inset;".

What does box-shadow mean in css3

The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.

What does box-shadow mean in css3

In CSS3, "box-shadow" means "box shadow", which is a new attribute that adds border shadow to elements.

What does box-shadow mean in css3

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

Note: Use border-image-* attributes to construct beautiful scalable buttons!

Syntax:

box-shadow: h-shadow v-shadow blur spread color inset;
Copy after login

box-shadow Adds one or more shadows to the box. This property is a comma-separated list of shadows, each specified by 2-4 length values, an optional color value, and the optional inset keyword. The value for omitted length is 0.

  • h-shadow Required. The position of the horizontal shadow. Negative values are allowed.

  • v-shadow Required. The position of the vertical shadow. Negative values are allowed.

  • blur Optional. Fuzzy distance.

  • spread Optional. The size of the shadow.

  • color Optional. The color of the shadow. See CSS color values.

  • inset Optional. Change the outer shadow (outset) to an inner shadow.

The following are a few small tests I did for everyone:

     
Copy after login

Running results:
What does box-shadow mean in css3

We also practiced Learn how to create "polaroid" photos and rotate pictures. For example:

     

The pulpit rock in Lysefjorden, Norway.

Monterosso al Mare. One of the five villages in Cinque Terre.

Copy after login

The running result is as follows:

What does box-shadow mean in css3

·There are many kinds of box-shadow shadows, such as: inner shadow, outer shadow, three-sided shadow, and two-sided shadow Shadow, single-sided shadow, western stroke...,

means:

What does box-shadow mean in css3For example:

内阴影示例

3边内影示例

外阴影示例

右下外阴影示例

扩大阴影示例

半透明阴影色示例

Copy after login

css:

.flex{display:flex;flex-wrap:wrap;} .flex-item{margin-right:30px;} .box { background-color: #CCCCCC; border-radius:10px; width: 200px; height: 200px; } .boxshadow1{ box-shadow:inset 0px 0px 5px 1px #000; } .boxshadow2{ box-shadow:inset 0 1px 2px 1px #000; } .boxshadow3{box-shadow:0 0 10px #000;} .boxshadow4{box-shadow:2px 2px 5px #000;} .boxshadow5{box-shadow:0 0 5px 15px #000;} .boxshadow6{box-shadow: 12px 12px 2px 1px rgba(0, 0, 255, .2);}
Copy after login

Running results:

What does box-shadow mean in css3

(Learning video sharing:css video tutorial,web front-end Getting Started Tutorial)

The above is the detailed content of What does box-shadow mean in css3. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!