Is there any accepted standard or tag (HTML or otherwise) for a definition when it ISN'T an abbreviation or acronym? For instance, if I said "My house is mahogany and blue" and I wanted a tooltip (like the title of an anchor tag) on mahogany to read, "a color", is there some other way I ought to mark it, or should I just use anchor tags?
To make it more clear, the code I'm referencing is: My house is <a title="a color">mahogany</a> and blue
4 answers
points
isn't abusing title to get tooltips a "bad" idea? Using a link element that doesn't go anywhere to create a tooltip for mouse users is poor practice in terms of accessibility.
What about the dfn element?
alternatively add a link to a footnote and enhance its presentation with CSS, like this:
http://www.twinhelix.com/dhtml/supernote/demo/
point
You can use the title attribute on much more than just anchor tags to display a basic system tooltip.
The W3C HTML 4.01 recommendation states that titles can be used on any number of HTML elements
You can use this page to check whether the title attribute is valid for the element you are using, div and p elements for example both support it
points
Ah, good point. I had forgotten just how many elements support titles. For now, I've decided to use spans and style it with a CSS class. There ought to be some element like abbr or acronym, but for definitions. (Yes, I know there's definition lists, but that's not quite what I want.)
- dfn is the element like abbr and acronym that is used to wrap a word that is the defining instance of the enclosed term.
points
Tony, while I don't see the issue in using title to, well, title something, dfn is exactly what I was looking for. Thank you much.
