Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

91
Vistas
Animate the position of elements together in a single wrapper or every element separately?

The layout of my simple website is that there are 3 sections below each other with different background and every section have it's own textual content. I want to achieve so called 3D perspective effect, that the content text will throw shadow over the background section and when scrolling, the text will scroll a little bit faster than background.

Now there are thow ways of organizing the code:

First - every section (with background) have it's own content:

<main>
  <section class="background-1">
    <div class="content-1">Some text and image</div>
  </section>
  <section class="background-2">
    <div class="content-2">Some text and image</div>
  </section>
  <section class="background-3">
    <div class="content-3">Some text and image</div>
  </section>
</main>

Second - sections (serving as a background) and text contents (hovering over background) are separated:

<div class="backgrounds">
  <div class="background-1"></div>
  <div class="background-2"></div>
  <div class="background-3"></div>
</div>
<main class="contents">
  <section class="content-1">Some text and image</section>
  <section class="content-2">Some text and image</section>
  <section class="content-3">Some text and image</section>
</main>

The difference is, that in first case, we must animate let's say top property of every content separately and in second case only the .contents wrapper need to be animated.

What is more preferred way, especially considering mobile device performance, then SEO and other stuff?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda