How to Add Drop Shadow in Images Using CSS

CSS (Cascading Style Sheet) allows us to do various adjustments in HTML. Here I am going to explain you how to Add Shadow to Image using simple CSS. Background Image Shadow can rock the looks of your layout of site and really this is a best method of encouraging users to focus on site images.

Recommended: Create HTML Table With Online HTML Table Generator in Seconds

drop shadow

Suppose your site have several images and all the images have single property of CSS then you can try the code given below. This will add a clear Drop Shadows at every single sides of the image.

.images {
-webkit-box-shadow: 0px 0px 8px 2px;
-moz-box-shadow: 0px 0px 8px 2px;
box-shadow: 0px 0px 8px 2px;

Here first two PX defines the shadow range horizontally and vertically where other two PX defines the shadow blur and show depth.

[ 0px opx 8px 2px = (Horizontal) (Vertical) (Blur) (Depth) ]

If you want a specific color of shadow then you can also add colors to this shadow by adding a HEX Color code in front of all the syntaxes. Here for demonstration I am using Red (#FF0000) Hex code.

.images {
-webkit-box-shadow: 0px 0px 8px 2px #FF0000;
-moz-box-shadow: 0px 0px 8px 2px #FF0000;
box-shadow: 0px 0px 8px 2px #FF0000;

By this way you can apply a drop shadow behind any images that you want using this simple CSS code. This will not only gives a better looks but also attacks the visitors to look at you images.

Abhay Pratap Singh
Abhay Pratap Singh is Digital Entrepreneur, Who is Making Money From the Internet since 2012. He Also Works as a Freelancer and Does Web and Mobile app Development. Apart from That, He Invests in Stock Market and Crypto Currencies. Here in iTechCube, Writes about Blogging, WordPress Guides, and Tutorials to help begginers.

Related Articles


Please enter your comment!
Please enter your name here