0

I have an image like this one:

<img class="alignnone size-full wp-image-262" src="http:/localhost/wp-content/uploads/2017/10/myimage.png" alt="" width="352" height="343" />

I would like to put text in a box and this appears when the mouse hovers on from the image. How is it possible to make it?

Agata Cortle
  • 39
  • 1
  • 2
  • 10

1 Answers1

0

You can use:

<img ... title="TEXT HERE">

Here's a quick JSFiddle demo for you.

https://jsfiddle.net/23vbh1ov/

<img src="http://dev.benchanmusic.com/wp-content/uploads/2017/07/cropped-cropped-me_blackandwhite.jpg" alt="" width="352" height="343" title="TEXT HERE" />

You should also fill in the "alt" property, as it's used for search engine indexing as well as if the image itself fails to load for any reason.

Ben Chan
  • 240
  • 3
  • 10
  • Is is possible to use a textbox because I have a text with more than 500 words and I would like to customize it for padding in order to not be a long list? – Agata Cortle Oct 15 '17 at 10:01
  • Here's a link to a related question that discusses how to use jQuery tooltip. It includes some CSS rules so I believe it can handle longer text, although I'm not positive as I haven't used this myself yet. But I probably will out of curiosity! – Ben Chan Oct 15 '17 at 12:31
  • https://stackoverflow.com/questions/18517483/displaying-long-text-in-bootstrap-tooltip – Ben Chan Oct 15 '17 at 12:31