< /code>
css: < /p>
Код: Выделить всё
.image-container {
position: relative;
width: 688px;
height: 800px;
}
.masked-image {
width: 100%;
height: 100%;
object-fit: cover;
clip-path: path('{{ Same path data as the Tailwind link above, StackOverflow just has a character limit. }}');
}
< /code>
Как уже упоминалось выше, я также пытался заставить это работать немного по -другому: < /p>
html: < /p>
[img]https://images.unsplash.com/photo-1691687824517-a62cfdef9c6e?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHx[/img]
d="{{ Same path data as the Tailwind link above, StackOverflow just has a character limit. }}"/>
< /code>
css: < /p>
.image-container img {
clip-path: url(#svg-mask);
}
Подробнее здесь: https://stackoverflow.com/questions/769 ... -clip-path