View Full Version : Attribute title="some text"

07-11-2002, 04:49 PM
The value of the title attribute is rendered by most visual browsers as a tool tip. Is there a way to change the style and behaviour of this tool tip (say I want it to appear immideately, have black background and white text). I looked into it but could not find any info.

Please, do not post the links to custom tooltip scripts. The reason I'm asking this question is that I developed my own script (can be found here (www.vladdy.net/WebDesign/Tooltips.html) ).
I want to make sure that the statement "currently browsers do not allow to customize the behaviour and appearance of tool tips" is correct.


Soldier Bob
07-11-2002, 05:00 PM
NS 4.x types etc wont allow you to change a popup "tooltip".

As far as the latest and greatest on NS6/7 or IE 6 I dont know for sure.

It would seem the IE side of things might allow some customization.

But making your own layer popup/hide, is probably the only stable way to do a tool tip.

-S. Bob

07-11-2002, 07:29 PM
To my knowledge, you can't change the behavior of the tooltip in any browser without some of your own effects.

Gecko would make it easy to implement your own version of title:

*[title] {
-moz-binding: url(mytitle.xml#title);

And then you could write a binding that copies the title text, removes the attribute (prevents default behavior from happening), then popping up an appropriate layer.

It would be slightly more complicated to make it as transparent in IE (actually, you would have to use * { behavior: url(bla.htc); } and check for the title attribute, but this becomes less transparent as any other element with an assigned behavior would get wiped out).

But for your original question - I'd love to be proven wrong, but I'm pretty sure.

07-11-2002, 07:45 PM
Thanks, jkd.

As I said I finished the implementation of tool tips for DOM compliant browsers and just wanna make sure that I state correctly that default browser tool tip is not customizable.

07-11-2002, 08:11 PM
Those tooltips cant be customized because they are just the default system tooltips,which cant be fully customized (although real applications can change the way they look)

07-11-2002, 08:35 PM
Well, if you have nothing against XUL :D (taken from XULPlanet tutorial):

<?xml version="1.0"?>

<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>

id="example-window" title="Example 5.3.2"

<button label="Save" tooltiptext="Click here to save your stuff"/>

<tooltip id="moretip" orient="vertical" style="background-color: #33DD00;">
<description value="Click here to see more information"/>
<description value="Really!" style="color: red;"/>

<button label="More" tooltip="moretip"/>


But I don't believe you could migrate that to any HTML/XHTML document.