Get the App
SLTechnology News&Howtos  ›  Development  › 

How to achieve Shadow effect with CSS

Shulou Source: shulou.com Published: 2022-06-01 12:54:00 10月04日 Update

This article is to share with you about how CSS achieves shadow effects. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Box-shadow: used to add shadows. It has four properties:

Abscissa offset (fixed point relative to the upper-left corner of the element)

Ordinate offset (fixed point relative to the upper left corner of the element)

Blur distance (blur shadow boundaries to prevent them from being too sharp)

The color of the shaded part.

Let's take a look at the specific applications:

Border-(yisu.com) div {height: 100px; widthbank 100px; background-color: red; box-shadow: 10px 10px 5px # 333 / * Abscissa offset ordinate offset blur distance shadow color * /} img {box-shadow: 5px 5px 5px # 333; margin-top: 10px;}

w3cschool

Thank you for reading! This is the end of the article on "how to achieve Shadow effect in CSS". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

Tags: Shadow offset effect element content fixed point upper left corner more Abscissa article ordinate color good practical sharp attribute article look knowledge border Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple Linux MariaDB MySQL vpn