f



popup text when the pointer is on some text

Hi,
on most (all?) browsers, when you put the pointer on a
<a href="..." title="popup text">this is a link</a>
without clicking on the link, there is a popup caption with the "popup
text".

I would like to achieve the same with some text that is not a link.
I realized that I could simply make it 
<a title="popup text">this is just some text</a>

My question: is it the best way to achieve what I want?
Are there alternative ways?
Is it portable?

Thank you!
0
Orloff
7/30/2005 8:33:22 AM
comp.authoring.html 7078 articles. 0 followers. Post Follow

8 Replies
597 Views

Similar Articles

[PageSpeed] 47

Once upon a time *Orloff* wrote:
> Hi,
> on most (all?) browsers, when you put the pointer on a
> <a href="..." title="popup text">this is a link</a>
> without clicking on the link, there is a popup caption with the "popup
> text".
> 
> I would like to achieve the same with some text that is not a link.
> I realized that I could simply make it 
> <a title="popup text">this is just some text</a>
> 
> My question: is it the best way to achieve what I want?
> Are there alternative ways?
> Is it portable?
> 
> Thank you!

Yes, it's the best way. However, if you like to add longer text that
wraps into several lines within the tooltip box, you need to use
Javascript (DHTML) like the examples shows here:

http://www.walterzorn.com/tooltip/tooltip_e.htm

Of course, it will not work if the browser don't support Javascript
(have Javascript disabled)

-- 
/Arne
My "widget" site: http://hem.bredband.net/arnel/
Top posters will be ignored. Quote the part you
are replying to, and don't quote signatures!
0
Arne
7/30/2005 8:52:02 AM
Arne wrote:

> Once upon a time *Orloff* wrote:
>> Hi,
>> on most (all?) browsers, when you put the pointer on a
>> <a href="..." title="popup text">this is a link</a>
>> without clicking on the link, there is a popup caption with the "popup
>> text".
>> 
>> I would like to achieve the same with some text that is not a link.
>> I realized that I could simply make it
>> <a title="popup text">this is just some text</a>
>> 
>> My question: is it the best way to achieve what I want?
>> Are there alternative ways?
>> Is it portable?
>> 
>> Thank you!
> 
> Yes, it's the best way. However, if you like to add longer text that
> wraps into several lines within the tooltip box, you need to use
> Javascript (DHTML) like the examples shows here:
> 
> http://www.walterzorn.com/tooltip/tooltip_e.htm
> 
> Of course, it will not work if the browser don't support Javascript
> (have Javascript disabled)
> 

Thanks Arne.
0
Orloff
7/30/2005 10:25:36 AM
Orloff wrote:

> <a title="popup text">this is just some text</a>

> My question: is it the best way to achieve what I want?

No. Anchors should be links or link targets. 

> Are there alternative ways?

Use a more suitable element. What that is depends on what the text is (e.g.
expansion of an abbreviation, a definition, etc), and could be abbr, dfn,
span, or something else.

> Is it portable?

To some degree. Advisory text (which is what the title attribute holds)
shouldn't be essential reading though.

-- 
David Dorward       <http://blog.dorward.me.uk/>   <http://dorward.me.uk/>
                     Home is where the ~/.bashrc is
0
David
7/30/2005 11:45:18 AM
On Sat, 30 Jul 2005 10:33:22 +0200, Orloff <x@hotmail.com> wrote:

><a title="popup text">this is just some text</a>
>
>My question: is it the best way to achieve what I want?
>Are there alternative ways?

Just use the title attribute and put it on any element you wish - you
don't need to add spurious <a> elements.

It'll generally work, for most elements, most of the time.
0
Andy
7/30/2005 2:41:08 PM
On Sat, 30 Jul 2005, Orloff wrote:

> I would like to achieve the same with some text that is not a link.
> I realized that I could simply make it
> <a title="popup text">this is just some text</a>

This is no anchor; write
 <span title="popup text">this is just some text</span>
or - better - with a meaningful element instead of "span".
For an example, see
 http://www.unics.uni-hannover.de/nhtcapri/arabic.html6
which has lots of <dfn title=...>.

-- 
Top-posting.
What's the most irritating thing on Usenet?

0
Andreas
8/1/2005 1:31:20 PM
Andreas Prilop wrote:

> On Sat, 30 Jul 2005, Orloff wrote:
> 
>> I would like to achieve the same with some text that is not a link.
>> I realized that I could simply make it
>> <a title="popup text">this is just some text</a>
> 
> This is no anchor; write
>  <span title="popup text">this is just some text</span>
> or - better - with a meaningful element instead of "span".
> For an example, see
>  http://www.unics.uni-hannover.de/nhtcapri/arabic.html6
> which has lots of <dfn title=...>.
> 

Thank you.
0
Orloff
8/1/2005 6:15:33 PM
Orloff wrote :
> Hi,
> on most (all?) browsers, when you put the pointer on a
> <a href="..." title="popup text">this is a link</a>
> without clicking on the link, there is a popup caption with the "popup
> text".
> 

Such popup caption purpose was specifically defined in the W3C specs and 
various documents (WAI, HTML 4.01, WCAG). It should be short (under 100 
characters) and it should only be used to add additional, complementary 
info to the link text like defining the target of the link or mode of 
opening the referenced resource (like opening a new secondary window).
The W3C documents insist on defining a meaningful link text, which can 
be understood even without its context.

> I would like to achieve the same with some text that is not a link.
> I realized that I could simply make it 
> <a title="popup text">this is just some text</a>
> 
> My question: is it the best way to achieve what I want?

It depends on the element. The W3C documents discourage explicitly to 
use title attribute on the following elements:

table
caption
img

and the W3C documents encourage explicitly to use title attribute when 
needed, when it can help for the following elements:

a
abbr
acronym
frame

> Are there alternative ways?
> Is it portable?

Many user agents will not render the title attribute in a tooltip or 
elsewhere: most text browsers. Keyboard navigation will not render the 
title attribute in visual browsers.
What's important to remember is that the title attribute should be short 
and should not hold crucial, important info in order to understand the 
document or to navigate in the document.

G�rard
--
remove blah to email me
0
ISO
8/14/2005 5:07:02 AM
G�rard Talbot wrote:
> 
> Orloff wrote :
> > Hi,
> > on most (all?) browsers, when you put the pointer on a
> > <a href="..." title="popup text">this is a link</a>
> > without clicking on the link, there is a popup caption with the "popup
> > text".
> >
> 
> Such popup caption purpose was specifically defined in the W3C specs and
> various documents (WAI, HTML 4.01, WCAG). It should be short (under 100
> characters) and it should only be used to add additional, complementary
> info to the link text like defining the target of the link or mode of
> opening the referenced resource (like opening a new secondary window).
> The W3C documents insist on defining a meaningful link text, which can
> be understood even without its context.
> 
> > I would like to achieve the same with some text that is not a link.
> > I realized that I could simply make it
> > <a title="popup text">this is just some text</a>
> >
> > My question: is it the best way to achieve what I want?
> 
> It depends on the element. The W3C documents discourage explicitly to
> use title attribute on the following elements:
> 
> table
> caption
> img
> 
> and the W3C documents encourage explicitly to use title attribute when
> needed, when it can help for the following elements:
> 
> a
> abbr
> acronym
> frame
> 
> > Are there alternative ways?
> > Is it portable?
> 
> Many user agents will not render the title attribute in a tooltip or
> elsewhere: most text browsers. Keyboard navigation will not render the
> title attribute in visual browsers.
> What's important to remember is that the title attribute should be short
> and should not hold crucial, important info in order to understand the
> document or to navigate in the document.

Per the HTML 4.01 specification, the title attribute is allowed for
all elements except BASE, BASEFONT, HEAD, HTML, META, PARAM,
SCRIPT, and TITLE.  Note that these eight elements do not create
visible content over which a cursor can be placed.  

The specification does not indicate that the title attribute is
decprecated for the table, caption, or img elements.  Indeed,
others strongly recommend the title attribute for the img element
where the Web author expects the alt attribute to produce a tooltip
for a visible image with a visual browser.  They would reserve the
alt attribute only for situations in which the image is not
visible, not for producing a tooltip over a visible image.  They
take the specification's description of the alt attribute:
	"For user agents that cannot display images, 
	forms, or applets, this attribute specifies 
	alternate text."  
as prohibiting any other use.  Thus, the title attribute is
appropriate for such things as indicating copyright information for
an image or describing a link in which the image is the only inline
content of the anchor element.  

Where my own pages have thumbnails of photographs as links to other
pages that have the full-sized photos, I use the title attribute in
the img tags (the inline contents of the links) to indicate the
download sizes of the pages with the full-size photos.  These are
useful warnings for those users (almost half of those who access
the Internet from home) who still use dial-up modems.  

-- 

David E. Ross
<URL:http://www.rossde.com/>  

I use Mozilla as my Web browser because I want a browser that 
complies with Web standards.  See <URL:http://www.mozilla.org/>.
0
David
8/14/2005 8:04:41 PM
Reply: