0

Пример:

.header__mid {
  max-width: 635px;
  margin: 0 auto;
  padding: 0 15px;
  position: relative;
  border: 1px solid red;
  background: #ccc;
}

.header__title {
  padding-top: 20px;
  margin: 0 auto;
  font-weight: 400;
  font-size: 30px;
  color: #fff;
  max-width: 635px;
  padding-bottom: 40px;
  z-index: 2;
}

.header__subtitle {
  font-weight: 400;
  font-size: 16px;
  line-height: 42px;
  margin-left: 30%;
  max-width: 445px;
  color: #fff;
  padding-bottom: 40px;
}

.header__link {
  padding: 15px 40px;
  border: 2px solid #fff;
  color: #fff;
  text-align: center;
}

.header__line {
  position: absolute;
  content: "";
  width: 344px;
  height: 720px;
  background: rgba(0, 91, 193, 0.6);
  left: -150px;
  top: 0px;
  z-index: 0;
  opacity: 50%;
}
<div class="header__mid">
  <h1 class="header__title">Светотехническое оборудование в Петербурге</h1>
  <div class="header__subtitle">Продажа, аренда светотехнического оборудования. Оформление официальных мероприятий под ключ.</div>
  <a class="header__link" href="#">ПЕРЕЙТИ</a>
  <h5 class="header__line"></h5>
</div>

  [1]: https://i.stack.imgur.com/zDaZV.jpg
3
  • наверное перекрыть z-index 27 июн 2022 в 17:29
  • не помогает, указал, но ничего особо не дало 27 июн 2022 в 18:21
  • Добавьте так же блокам с текстом position: relative
    – HaZcker
    27 июн 2022 в 18:58

1 ответ 1

1
.header__title {
  position: relative;
  z-index: 1;
  /* other styles */
}

.header__subtitle {
  position: relative;
  z-index: 1;
  /* other styles */
}

Ваш ответ

Нажимая на кнопку «Отправить ответ», вы соглашаетесь с нашими условиями использования и подтверждаете, что прочитали и поняли наши политику конфиденциальности и нормы поведения.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.