Adding Drop Shadow to Images using CSS3

CSSWeb DevelopmentFront End Technology

To add drop shadow to image in CSS3, use the drop-shadow value for filter property. It has the following values −

h-shadow – To specify a pixel value for the horizontal shadow.

v-shadow – To specify a pixel value for the vertical shadow. Negative values place the shadow above the image.

blur – To add a blur effect to the shadow.

spread - Positive values causes the shadow to expand and negative to shrink.

color – To add color to the shadow

Example

 Live Demo

<!DOCTYPE html>
<html>
<head>
<style>
img.demo {
   filter: brightness(120%);
   filter: contrast(120%);
   filter: drop-shadow(10px 10px 10px green);
}
</style>
</head>
<body>
<h1>Learn MySQL</h1>
<img src="https://www.tutorialspoint.com/mysql/images/mysql-mini-logo.jpg" alt="MySQL" width="160" height="150">
<h1>Learn MySQL</h1>
<img class="demo" src="https://www.tutorialspoint.com/mysql/images/mysql-mini-logo.jpg" alt="MySQL" width="160" height="150">
</body>
</html>

Output

raja
Published on 27-Dec-2019 14:03:51
Advertisements