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 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. You can see the working of this effect in the Image hover effects collection page , lets move into the CSS and HTML coding of this effect.
CSS CODE:
|
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:
|
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.
I hope this effect will be useful to you all, share this with others through social sites if you like it. Feel free to post your comments and queries regarding this hover effect below. Thank you for visiting us and Happy Coding.