Learn how to create a responsive cutouttext with CSS. cutouttext is also known as knockout.
Here is a quick example of how you can produce Cutout Effect in CSS.
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {font-family: Arial, Helvetica, sans-serif;}
.image-container {
background-image: url("https://cn.opendesktop.org/img/4/2/6/e/641fe0ec80ce64b1f4f4f2cebd3a79fd4dee.jpg");
background-size: cover;
position: relative;
height: 300px;
}
.text {
background-color: white;
color: black;
font-size: 10vw;
font-weight: bold;
margin: 0 auto;
padding: 10px;
width: 50%;
text-align: center;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
mix-blend-mode: screen;
}
</style>
</head>
<body>
<h2>Responsive Cutout Text Effect</h2>
<div class="image-container">
<div class="text">NATURE</div>
</div>
<p><strong>Note:</strong> This example does not work in Internet Explorer or Edge.</p>
</body>
</html>
Leave a Reply