Image hover Mask effect using CSS and HTML

Image hover effects using simple CSS and HTML are quite familiar among the web designers since it boost the attraction of a site. There are several types of image hover effects widely spread over the internet and today we are about to see a similar one in this article. This Image hover mask effect is nothing but a simple mask over the image before hovering and when hovered the mask will be removed to reveal the background picture.

In the above CSS code we are implementing the mask over the image using the “box-shadow” property. The “inset” value in the “box-shadow” specifies that the shadow should be inside the image as if the content was depressed inside the box. Then offset-x, offset-y, blur-radius, spread-radius was given using a series of values 0 0 1px 250px in the above code and color was given using the rgba model. Thus it gives a look of a mask over the image and the mask will be removed when the image was hovered.

HTML CODE:

<div class="mask bg"></div>

The HTML code of this hover effect is simple as all we have to do is make a <div> container with the class “mask bg” to use the properties of both the class