Como fazer - Texto recortado
Aprenda a criar um texto de recorte/nocaute responsivo com CSS.
Um texto recortado (ou texto vazado) é um texto transparente que aparece recortado em cima de uma imagem de fundo:
NATUREZA
Nota: Este exemplo não funciona no Internet Explorer ou Edge.
Como criar um texto de recorte
Etapa 1) Adicionar HTML:
Exemplo
<div class="image-container">
<div class="text">NATURE</div>
</div>
Etapa 2) Adicionar CSS:
A mix-blend-mode
propriedade permite adicionar o texto do recorte à imagem. No entanto, não é compatível com IE ou Edge:
Exemplo
.image-container {
background-image: url("img_nature.jpg");
/* The image used - important! */
background-size: cover;
position: relative; /* Needed to position
the cutout text in the middle of the image */
height: 300px; /* Some
height */
}
.text {
background-color: white;
color: black;
font-size: 10vw;
/* Responsive font size */
font-weight: bold;
margin: 0 auto; /* Center the text container */
padding: 10px;
width: 50%;
text-align: center; /* Center text */
position: absolute; /* Position text */
top: 50%; /* Position text in the middle */
left: 50%; /* Position
text in the middle */
transform: translate(-50%, -50%); /* Position text in the middle */
mix-blend-mode: screen;
/* This makes the cutout text possible */
}
Se você quiser um texto de contêiner preto, altere o modo de mesclagem para "multiplicar" e a cor de fundo para preto e a cor para branco:
Exemplo
.text {
background-color: black;
color: white;
mix-blend-mode:
multiply;
....
}