Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I add a tool tip to a span element?

Tags:

html

css

In the following code, I want a tool-tip to come up when the user hovers the span, how do I do that? I don't want to use any links.

<span> text </span> 
like image 907
MichaelICE Avatar asked Jun 28 '09 19:06

MichaelICE


People also ask

Can I put a tooltip on a span?

You can also control the position of the custom tooltip using the data-tooltip-position attribute (accepted values: top / right / bottom / left ). For instance, the following will add a tooltop positioned at the bottom of the span element.

How do I add a tooltip to a table?

Select your table visual. Go to the paint roller icon (format). Scroll down and turn on Tool Tip.

How do I add a tooltip to a photo tag?

Use document. getElementById('theImage'). title='tooltip text' .


1 Answers

Here's the simple, built-in way:

<span title="My tip">text</span>

That gives you plain text tooltips. If you want rich tooltips, with formatted HTML in them, you'll need to use a library to do that. Fortunately there are loads of those.

like image 124
RichieHindle Avatar answered Nov 17 '22 23:11

RichieHindle