MichaelICE MichaelICE - 1 year ago 71
CSS Question

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

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>

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download