How do I mouse over key word for definition

  • Thread starter Thread starter Dave
  • Start date Start date
D

Dave

I want to allow the end-user to place the mouse on a word and get the
definition of that word. When the mouse moves off of the word, the message
closes.

Is there a way to do this?

Thanks

dave
 
You can use the title= attribute like this:
<p>Would you like a definition for <span title="n 1: a unit of language that
native speakers can identify">word</span>?</p>

The <span> tags allow you to identify the specific word within the sentence.
The title= value is what will be displayed in a tooltip format when the user
places their mouse over the word.

You could use Cascading Style Sheets to highlight the defined word to give
it a visual cue for the user, for example:
span {
text-decoration: underline;
}

or just throw <strong> tags around the word:
<span title="n 1: a unit of language that native speakers can
identify"><strong>word</strong></span>

Good luck!
 
interesting, thanks

Jack Brewster said:
You can use the title= attribute like this:
<p>Would you like a definition for <span title="n 1: a unit of language that
native speakers can identify">word</span>?</p>

The <span> tags allow you to identify the specific word within the sentence.
The title= value is what will be displayed in a tooltip format when the user
places their mouse over the word.

You could use Cascading Style Sheets to highlight the defined word to give
it a visual cue for the user, for example:
span {
text-decoration: underline;
}

or just throw <strong> tags around the word:
<span title="n 1: a unit of language that native speakers can
identify"><strong>word</strong></span>

Good luck!
 
Back
Top