20
Окт
2021

Как реализовать паралакс?

как тут https://toccata.com.ua/

.image {
  background-image: url(http://toccata.com.ua/uploads/main-bg.jpg);
  background-size: cover;
  background-attachment: scroll;
  background-position: top center;
  padding: 200px 0;
}

body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  color: #333333;
  background-color: #fff;
  line-height: 1.2;
  font-weight: normal;
  font-style: normal;
}

.image h1, .image p {
  color: #fff;
}
<section class="image">
  <div class="container">
    <h1>title title</h1>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Doloremque in provident enim placeat tenetur repudiandae illum consequatur quaerat adipisci autem! Recusandae amet inventore aut modi, itaque eaque incidunt totam nemo.</p>
  </div>
</section>

<section class="content">
  <div class="container">
    <h1>title title</h1>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Doloremque in provident enim placeat tenetur repudiandae illum consequatur quaerat adipisci autem! Recusandae amet inventore aut modi, itaque eaque incidunt totam nemo.</p>
  </div>
</section>

<section class="content">
  <div class="container">
    <h1>title title</h1>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Doloremque in provident enim placeat tenetur repudiandae illum consequatur quaerat adipisci autem! Recusandae amet inventore aut modi, itaque eaque incidunt totam nemo.</p>
    
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Doloremque in provident enim placeat tenetur repudiandae illum consequatur quaerat adipisci autem! Recusandae amet inventore aut modi, itaque eaque incidunt totam nemo.</p>
  </div>
</section>

Источник: https://ru.stackoverflow.com/questions/1340062/%D0%9A%D0%B0%D0%BA-%D1%80%D0%B5%D0%B0%D0%BB%D0%B8%D0%B7%D0%BE%D0%B2%D0%B0%D1%82%D1%8C-%D0%BF%D0%B0%D1%80%D0%B0%D0%BB%D0%B0%D0%BA%D1%81

Тебе может это понравится...

Добавить комментарий