Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the easiest way to create an HTML mouseover tool tip?

Tags:

html

tooltip

What is the easiest, cleanest way to create an HTML mouseover tool tip without using JavaScript?

<img id=Pennstate src="/blah" style="cursor:pointer;"> 

mouse over that and have a a nice tooltip "We are Pennstate!"

like image 485
stackoverflow Avatar asked Sep 21 '11 16:09

stackoverflow


People also ask

How do you make a mouseover tooltip in HTML?

HTML: Use a container element (like <div>) and add the "tooltip" class to it. When the user mouse over this <div>, it will show the tooltip text. The tooltip text is placed inside an inline element (like <span>) with class="tooltiptext" .

What is a tooltip in HTML code?

Tooltips display text (or other content) when you hover over an HTML element. The w3-tooltip class defines the element to hover over (the tooltip container). The w3-text class defines the tooltip text.

How do I create a tooltip for my website?

So open Userpilot and go to the “Native Tooltips” section. At the top-right, you'll see a magenta button saying “Create a New Native Tooltip.” Click on that button, and specify the page on your website that you want the tooltip on.


2 Answers

The easiest way is to use the native HTML title attribute:

<img src="https://stackoverflow.com/favicon.ico"       style="cursor:pointer;"       title="Stack Overflow">

But if you need more, try the tooltip widget provided by jQuery UI since version 1.9.

like image 199
Samich Avatar answered Sep 22 '22 06:09

Samich


If you don't care much what the tooltip looks like you can always just use the "title" attribute

like image 39
Jaime Garcia Avatar answered Sep 20 '22 06:09

Jaime Garcia