Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

81
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda