Can I set alternative text when hovering over a block?

The img tag has an alt attribute; when you hover the cursor over a picture, the test set in this attribute pops up. Is it possible to do this for a block? Those. You need to replace the picture with a block with a background with preservation of behavior.

  • google tooltips, tooltips - zloctb


1 answer 1

<div title="здесь текст"></div> 
  • one
    This is not an answer. - Artem
  • 2
    And what about zaminusovali? What is the question is the answer! The div tag supports the title attribute. - Palmervan
  • Well, you can still create anything yourself using javascript. When hovering, call the function, and then display the pop-up text with animation, make a delay before the show, change the color, etc. <script> function functi (text) {alert (text); } </ script> <div onmouseover = "functi ('here is the text')"> </ div> - manking
  • 3
    And this comment is in vain ... If he had the answer, I would have put the third minus! Think before you do something! - Palmervan
  • I asked about it. Stupidity, but I somehow did not know and did not think that the div had such an attribute. - nMike