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

77
Vistas
Styling pseudo element when its immediate parent is also repeating

Code :

questions.map((question, index) => (

                  <div
                    className={styles.questionContainer}}
                  >
                    <div className={styles.circle}>
                      <span> {index + 1} </span>
                    </div>
                    <span
                    >
                      {question.questiontext}
                    </span>
                  </div>

I am working on react project where I am looping through an array and creating dynamic div list. That div is further divided into two parts using display:flex.

Left side of that flex I want circle and bar which connects another circle and creating chain ( timeline kind of thing).

I want to hide line created for first element but when I try

 .circle:first-child::before {
  display:none;
 }

It hides all line since parent of .circle is also repeating. So can anyone help to understand how we can hide line created for first element can be hidden.

I am tring to achieve this result in terms of UI.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Without seeing the generated HTML I cannot be entirely sure, but it looks as though what you need to select is the first question and then stop the pseudo before element on its circle showing.

So something like this:

 .questionContainer:first-child .circle::before {
  display:none;
 }
about 4 years ago · Juan Pablo Isaza Denunciar
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