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

199
Visualizações
CSS Display InfoBox on hovering over <span> Element

I want to implement a functionality in my React app where you hover over a <span> element and then an InfoBox appears over the <span> element.

It should look like in Visual Studio code when you hover your cursor over a variable for example. VSCode on hover

The box should behave as in the following sketch I drew (basically it's the same behavior as in VSCode): The InfoBox is the box that contains This text. The <span> contains the hello

Sketch how the infoBox should behave

Unfortunately I'm not an expert in CSS and I don't even know if this is possible with CSS only or if you have to use javascript as well.

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

This might help:

.thisText{
  position:relative;
  top: 20px;
 }

.thisText > .hello{
  display: none;
}

.thisText:hover> .hello {
  display: block;
  position:absolute;
  top:-20px;
}

<span class="thisText">
This Text
  <span class="hello">
    Hello
  </span>
</span>
about 4 years ago · Juan Pablo Isaza Relatório

0

Is this what you are looking for?

Where you hover over some text and text below it appears?

.thisText > .hello {
  display: none;
}

.thisText:hover > .hello {
  display: block;
}
<span class="thisText">
This Text
  <span class="hello">
    Hello
  </span>
</span>

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