|
Posted by Barbara de Zoete on 11/16/05 00:57
On Tue, 15 Nov 2005 23:48:48 +0100, Stefan Mueller
<seekware-remove-@yahoo.com> wrote:
> I'd like to add a tooltip text to one word within a sentence.
>
> With the attribute <b>...</b> it works perfect but the word gets bold:
> What is <b title = "It's a planet">Pluto</b>?
Wel, yeaheh, that is what bold is supposed to do, isn't it.
BTW: what you call attributes are in fact elements and the way you note
them down (<b>) you use the tags.
> With the attribute <div>...</div> the word doesn't get bold but there is
> a line break:
> What is <div title = "It's a planet">Pluto</div>?
That is because the div is a block level element. What you need is an
inline element. >
> Is there an attribute I can use only to add a tooltip text to a word?
The generic inline element (if there is nothing more appropriate
available) is a span:
<URL:http://www.w3.org/TR/html401/struct/global.html#edef-SPAN>
Don't forget to style the span so visitors can see that the word has a
tooltip. I would do it something like:
markup:
What is <span class="answer" title="It is a planet">Pluto</span>?
styles:
span.anwer {
cursor:help;
border-bottom:1px dotted blue; }
It is doubtful we will regard Pluto a planet in some time from now btw,
but that is an entirely different matter :-)
--
,-- --<--@ -- PretLetters: 'woest wyf', met vele interesses: ----------.
| weblog | http://home.wanadoo.nl/b.de.zoete/_private/weblog.html |
| webontwerp | http://home.wanadoo.nl/b.de.zoete/html/webontwerp.html |
|zweefvliegen | http://home.wanadoo.nl/b.de.zoete/html/vliegen.html |
`-------------------------------------------------- --<--@ ------------'
[Back to original message]
|