Hovering definition text code?

  • Unknown's avatar

    Hi,

    This may be the question of a child, but i’ll be damned if I can figure it out. All I want is to be able to include one of those little hovering boxes of text that pop up when you hold the mouse over a word. Basically, I just want to be able to include a definition of problem words without obligating people to navigate away.

    For some reason, the few examples I’ve found online don’t seem to work when i cut and paste them into my junk. Is this not possible in wordpress? Am I just stupid?

    I don’t mean to bother anyone, but it seems like it would be incredibly simple for someone who knows how to point me in the right direction.

    DAVe

  • Unknown's avatar

    If you’re using acronyms and abbreviations you can use the abbr and acronym tags with a title attribute to show text in a tooltip when you hover over the word:

    <abbr title="World Health Organisation">WHO</abbr>

    lh

  • Unknown's avatar

    That is EXACTLY what I needed, my friend. Thanks so much fro your time.

    avsea

  • Unknown's avatar

    On second thought, it’s really great… but is there another command that gives you more characters to work with? Just curious…

  • Unknown's avatar

    Try this:
    <a style="cursor:help;" title="DEFINITION_HERE">WORD_HERE</a>

  • Unknown's avatar

    Tess,

    Actually, for a this purpose, using “a” tags is not semantically correct. It’s better if the OP used a “span” tag which you can style the same way as in your example.

    If the OP iis using acronyms or abbreviations, halluke’s solution is the appropriate one.

    HTH

  • Unknown's avatar

    nothingjustis,

    but is there another command that gives you more characters to work with?

    Would you please elaborate?

  • Unknown's avatar

    @devblog

    Thank you for the info.

    You know, I discovered that code from someone whose question I answered months ago. If I recall, she also had some part of her post written upside down. Both caught my fancy so I tried them out.

    The upside-down text was just some online conversion program and just a gimmick.

    But the cursor help seemed useful in a couple of my posts. It works with the “a” tags—but what you say makes good sense.

    Thank you!
    T

  • Unknown's avatar

    devblog-

    The “abbr” thing does exactly what I need, but after about ten words it fades off with a “…”

    I was just curious if there is some way for the popping-up text to be a bit lengthier.

    If it isn’t possible, then I can make it work.

    Thanks for all the input, by the way!

  • The topic ‘Hovering definition text code?’ is closed to new replies.