Cómo - Texto recortado
Aprenda a crear un texto recortado/noqueado receptivo con CSS.
Un texto recortado (o texto oculto) es un texto transparente que aparece recortado sobre una imagen de fondo:
NATURALEZA
Nota: Este ejemplo no funciona en Internet Explorer o Edge.
Cómo crear un texto recortado
Paso 1) Agregar HTML:
Ejemplo
<div class="image-container">
<div class="text">NATURE</div>
</div>
Paso 2) Agregar CSS:
La mix-blend-mode
propiedad hace posible agregar el texto recortado a la imagen. Sin embargo, no es compatible con IE o Edge:
Ejemplo
.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 */
}
Si desea un texto de contenedor negro, cambie el modo de mezcla a "multiplicar" y el color de fondo a negro y el color a blanco:
Ejemplo
.text {
background-color: black;
color: white;
mix-blend-mode:
multiply;
....
}