Skip to content

Instantly share code, notes, and snippets.

@biswajitpaul01
Created December 13, 2017 18:41
Show Gist options
  • Save biswajitpaul01/25e2d35276ca6d7a22558646602b6ba4 to your computer and use it in GitHub Desktop.
Save biswajitpaul01/25e2d35276ca6d7a22558646602b6ba4 to your computer and use it in GitHub Desktop.
CSS Text Masking
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Font Background Image Demo</title>
<link href="https://fonts.googleapis.com/css?family=Bungee:regular" rel="stylesheet" />
<style>
*{
margin: 0;
padding: 0;
}
.container {
display: grid;
place-items: center;
height: 100vh;
text-align: center;
overflow: hidden;
}
.item {
font-family: "Bungee";
font-size: 10em;
line-height: 1;
background-clip: text;
color: transparent;
-webkit-background-clip: text;
filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
background-image: url(https://wallpapercave.com/wp/nsu3cSp.jpg);
}
</style>
</head>
<body>
<div class="container">
<div class="item">Saturday Novemver 25, 2017</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment