Skip to content

Instantly share code, notes, and snippets.

@PrimeTimeTran
Last active April 10, 2024 05:30
Show Gist options
  • Save PrimeTimeTran/4b975ede406131bae6563a031b3029aa to your computer and use it in GitHub Desktop.
Save PrimeTimeTran/4b975ede406131bae6563a031b3029aa to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0"
/>
<title>Document</title>
<style>
.img::before {
content: ' ';
inset: 0;
z-index: 1;
opacity: 1;
position: absolute;
}
.img:hover:before {
z-index: -1;
opacity: 0.5;
background-image: url('https://plus.unsplash.com/premium_photo-1683910767532-3a25b821f7ae?q=80&w=2008&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D');
}
</style>
</head>
<body>
<div>
<div class="img">
<h1>Hello World</h1>
</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment