Skip to content

Instantly share code, notes, and snippets.

@geekboots-team
Last active May 23, 2024 12:32
Show Gist options
  • Select an option

  • Save geekboots-team/d96f34f4510ec19bb1a5b18d6972fbb6 to your computer and use it in GitHub Desktop.

Select an option

Save geekboots-team/d96f34f4510ec19bb1a5b18d6972fbb6 to your computer and use it in GitHub Desktop.
Create a Cool Splash Image Effect with HTML & CSS
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Splash Image</title>
<style>
* {
margin: 0;
padding: 0;
}
.container {
width: 100%;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
background: #fff;
}
.bgImg {
width: 500px;
height: 300px;
background-image: url("https://cdn.pixabay.com/photo/2020/02/15/16/09/loveourplanet-4851331_960_720.jpg");
background-repeat: no-repeat;
background-position: center;
background-size: contain;
position: relative;
}
.bgImg::after {
position: absolute;
content: "";
top: 0;
left: 0;
right: 0;
bottom: 0;
background-image: url("splash.jpg");
background-position: center;
background-size: cover;
background-repeat: no-repeat;
mix-blend-mode: lighten;
}
</style>
</head>
<body>
<div class="container">
<div class="bgImg"></div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment