Splash Image Mask Using HTML and CSS (Free Code)

Splash Image Mask Using HTML and CSS

Here you will learn how to create Splash Image Mask using HTML CSS. The CSS mask image is a kind of simple design where there will be a background color on the image. 

Some parts of that background will be transparent. As a result, we get to see some of the images in the background. You can use this CSS Splash Image Mask in any background image. 

Here I used HTML in Aklin which added image. Then I designed it with CSS. You can use this CSS mask background image in the background of any project.

Below is a preview that will help you to know how this Splash Image Mask CSS was created.


See the Pen Splash Image Mask using Html CSS by Shantanu Jana (@shantanu-jana) on CodePen.


Here HTML and CSS are used to create this CSS mask-image property. For this, you create an HTML and CSS file. 

Copy all the code given below and add it to your file. Or use the download button at the bottom of the article to download the code for this Splash Image Mask.


HTML Code:

The following code is the HTML code by which the basic structure of this mask background image has been created. No images are used here. I will add the image in CSS.


<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=1">
<title>Responsive Navigation Bar</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>

  <section></section>

</body>
</html>

CSS Code:

The following code is the CSS code by which the background image has been added. Then converted to mask-image. Copy the following code and add it to your css file.


body {
  margin: 0;
  padding: 0;
}
section {
  width: 100%;
  height: 100vh;
  background: url("https://i.postimg.cc/Dz52jhVn/woman-5443384-1920.jpg")
    no-repeat;
  background-size: 100% 100%;
  background-position: cover;
}
section:before {
  position: absolute;
  content: "";
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url("https://i.postimg.cc/xC1RKfRH/splash.jpg") no-repeat;
  background-size: 100% 100%;
  background-position: center;
  mix-blend-mode: screen;
}

Hopefully, you have been able to create this Splash Image Mask effect using the above code. If there is any problem then use the download button below. Please comment on how you like this CSS mask-image example.







Comments

Popular posts from this blog

Simple Day Night Toggle Button Using HTML and CSS

Simple RGB Color Generator Using JavaScript & CSS