473,388 Members | 976 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

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!
Jul 30 '05 #1
8 41536
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
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
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: who be dat? | last post by:
I'm trying to make a webpage do the following: I want a user to be able to click on a given image (there will be more than one image). Upon clicking a given image, characters specific to that...
3
by: leo | last post by:
Hello Guys I have this problem in controlling a text in a Text Area. How can I do that, for example the field size is 200, when it reaches 50 it automatically goes to the next line. Because im...
3
by: abc my vclass | last post by:
My win-form have many numericupdown controls to applied. But numericupdown control don't like textbox, text box control can automatic selected text when got focus. Is there any method can let me...
3
by: Learner | last post by:
Hello, I have two buttons on one of my VehicleDetails.aspx page. Obiviously these two buttons takes the user to two different pages. Now my client is interested in having a linkbutton instead of...
3
by: ASP Developer | last post by:
I have a variety of pages that use a master page. For some reason when I attempt to copy any of the label text on the screen it seems to highlight most of the screen randomly and I can't simply...
3
by: xplosiveconcepts | last post by:
Hello all, I have a very simple PHP script that is reading a plain-text CSV file and parses it out into into a HTML table to display the data. No biggie. What I want to do is while keeping...
6
by: nickwang | last post by:
Hi, does any javascript framework can implement image popup tip when mouse hover an object? Mootool has a text popup tips. Is it easy to inherit it and create a popup tip with images or other...
6
by: Eng Teng | last post by:
How do I write a code to activate a popup menu when I right click in a label control? Regards, Tee
1
by: dittu | last post by:
How to close the popup window when submitting the form? I have a sample.jsp. In that page one button is there. when button pressed, open popup window contains one "text box" and one " submit...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.