Home  >  Article  >  Web Front-end  >  How to add shadow effect to images in css

How to add shadow effect to images in css

WBOY
WBOYOriginal
2021-11-26 10:25:389467browse

In CSS, you can use the "box-shadow" attribute to add a shadow effect to the picture element. The function of this attribute is to add a shadow to the element box. You only need to add "box-shadow: horizontal shadow" to the picture element. Vertical shadow blur distance shadow size color inset;" style is enough.

How to add shadow effect to images in css

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

How to add a shadow effect to an image in css

In css, you can use the box-shadow attribute to add a shadow effect to an image. This attribute can Adds one or more shadows to the box. The syntax of this attribute is:

box-shadow: h-shadow v-shadow blur spread color inset;

What needs to be noted is:

How to add shadow effect to images in css

## Let’s take an example to see how to use the box-shadow attribute. To add a shadow effect to picture elements, the example is as follows:



  
    
    
    
    123
    
  

Output result:


How to add shadow effect to images in css

(Learning video sharing:

css video tutorial )

The above is the detailed content of How to add shadow effect to images in css. For more information, please follow other related articles on the PHP Chinese website!

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