By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,640 Members | 2,167 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,640 IT Pros & Developers. It's quick & easy.

popup text when the pointer is on some text

P: n/a
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!
Jul 30 '05 #1
Share this Question
Share on Google+
8 Replies


P: n/a
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!
Jul 30 '05 #2

P: n/a
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.
Jul 30 '05 #3

P: n/a
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
Jul 30 '05 #4

P: n/a
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.
Jul 30 '05 #5

P: n/a
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?

Aug 1 '05 #6

P: n/a
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.
Aug 1 '05 #7

P: n/a
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
Aug 14 '05 #8

P: n/a
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/>.
Aug 14 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.