views:

1626

answers:

5

Apologies if this is a n00b question but I can't find a straight answer anywhere.

Is it possible for format an HTML tooltip?

E.g. I have a DIV with attribute title="foo!". When I have text-size of my browser zoomed in or out in, the text size of the tooltip remains unchanged. Is there a way to make the tooltip font scale with the browser setting?

+8  A: 

No. But there are other options out there like Overlib, and jQuery that allow you this freedom.

Personally, I would suggest jQuery as the route to take. It's typically very unobtrusive, and requires no additional setup in the markup of your site (with the exception of adding the jquery script tag in your <head>).

Jonathan Sampson
+1  A: 

Mootools also has a nice 'Tips' class available in their 'more builder'.

tj111
+1  A: 

No, it's not possible, browsers have their own ways to implement tooltip. All you can do is to create some div that behaves like an HTML tooltip (mostly it's just 'show on hover') with Javascript, and then style it the way you want.

With this, you wouldn't have to worry about browser's zooming in or out, since the text inside the tooltip div is an actual HTML, it would scale accordingly.

See Jonathan's post for some good resource.

andyk
+1  A: 

It's not possible. But you can use some javascript libraries to create such tooltip, e.g. http://www.taggify.net/

A: 

it seems you can use css and a trick (no javascript) for doing it:

http://www.fijiwebdesign.com/blog/css-tooltips-floating-html-elements.html

matteo galiazzo