The handling of the title
attribute is browser-dependent, and no APIs have been defined to control it, still less specified in specs. This includes the delay, the duration of the display, the font used, font size, etc.
There are other techniques that can be used instead of the title
attribute. Some of them have been mentioned in other answers. Note that simple “CSS tooltips” can be implemented in pure CSS rather simply and flexibly. When using these techniques, the data to be shown is usually not in a title
attribute, since its handling is browser-dependent, so there would be a risk of having your special tooltip display and a browser’s implementation of title
. Though it is possible to prevent the latter, when scripting is enabled, it is simpler to use an attribute that has no default effect on anything, such as data-title=...
or data-tooltip=...
.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…