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

197
Visualizações
Animate component in tag 'details'

HTML:

.main-summary:before {
  content    : "+";
  font-size  : 2em;
  padding    : 0 0.5em;
  display    : inline-block;
  transition : .5s;
  color      : grey;
  transform  : rotate(0deg);
  }
summary:after {
  padding     : 0px .5em;
  text-align  : right;
  float       : right;
  display     : inline-block;
  content     : "∨";
  font-size   : .7em;
  transition  : .5s;
  width       : 90%;
  font-weight : 700;
  }
<details>
  <summary class="main-summary">
    <p>Main summary</p>
  </summary>
  <details>
    <summary>
      <p>Text in summary</p>
    </summary>
    <p>123</p>
  </details>
</details>
How can I make an animation for the main <details> tag so that the + sign 1 image flips over and becomes the closing icon X 2 image, and the ∨ at the end of <details> turned over and became an up arrow 3 image, but this is only for the open element, and not for all that are in the open tag.

1 image: https://i.stack.imgur.com/5x5cD.png
2 image: https://i.stack.imgur.com/oP9ic.png
3 image: https://i.stack.imgur.com/AMMA4.png

about 4 years ago · Santiago Trujillo
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