Мне нужно, чтобы белые буквы текли по траектории клипа.
Я пробовал z-index, но это не работает
Вот мой код:
.header {
height: 85vh;
background-image: linear-gradient(
to right bottom,
rgba(255,255,255, 0.8),
rgba(0,0,0, 0.8)),
url(../../img/hero.jpg);
background-size: cover;
background-position: top;
position: relative;
clip-path: polygon(100% 100%, 100% 0, 65% 100%, 63% 100%, 100% 0, 99% 0, 100% 0, 13% 100%, 11% 100%, 100% 0, 0 81%, 0 77%, 100% 0, 0 45%, 0 43%, 100% 0, 0 0, 0 0, 0 100%);<header class = "header">
<div class = "header__logo-box">
<img src = "img/logo-white.png" alt = "Logo" class = "header__logo">
</div>
<div class = "header__text-box">
<h1 class = "heading-primary">
<span class = "heading-primary--main">My Blog</span>
<span class = "heading-primary--sub">Enrique Cena</span>
</h1>
<a href = "#section-tours" class = "btn btn--white btn--animated">About me</a>
</div>





возможно, вы можете что-то сделать с помощью ниже:
.header {
position: relative;
height: 85vh;
width: 100%;
}
.header::before {
z-index: -1;
content: '';
top: 0;
left: 0;
position: absolute;
height: 100%;
width: 100%;
background-color: cyan;
background-size: cover;
background-position: top;
clip-path: polygon(100% 100%, 100% 0, 65% 100%, 63% 100%, 100% 0, 99% 0, 100% 0, 13% 100%, 11% 100%, 100% 0, 0 81%, 0 77%, 100% 0, 0 45%, 0 43%, 100% 0, 0 0, 0 0, 0 100%);
}
Пожалуйста, замените background-color на ваш background-image
Это мое решение: я беру h1 из текстового поля и помещаю текст и заголовок в div. Этот div .wrap такой же высокий, как и header. Я позиционирую h1 относительно этого div. Надеюсь, это поможет.
.header {
height: 85vh;
background-image: linear-gradient(
to right bottom,
rgba(0, 180, 180, 0.8),
rgba(0, 0, 255, 0.8)
),
url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/222579/featured-space-policy.jpg);
background-size: cover;
background-position: top;
position: relative;
clip-path: polygon(
100% 100%,
100% 0,
65% 100%,
63% 100%,
100% 0,
99% 0,
100% 0,
13% 100%,
11% 100%,
100% 0,
0 81%,
0 77%,
100% 0,
0 45%,
0 43%,
100% 0,
0 0,
0 0,
0 100%
);
}
.wrap {
position: relative;
height: auto;
}
h1 {
position: absolute;
display: block;
width: 100%;
height: 1em;
margin: auto;
text-align: center;
top: 0;
bottom: 0;
}<div class = "wrap">
<header class = "header">
<div class = "header__logo-box">
<img src = "https://s3-us-west-2.amazonaws.com/s.cdpn.io/222579/cat.svg#blackcat" alt = "Logo" class = "header__logo">
</div>
<div class = "header__text-box">
<a href = "#section-tours" class = "btn btn--white btn--animated">About me</a>
</div>
</header>
<h1 class = "heading-primary">
<span class = "heading-primary--main">My Blog</span>
<span class = "heading-primary--sub">Enrique Cena</span>
</h1>
</div>