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

newline inside <title>

P: n/a
Is it possible to insert newlines, or some other character,
into <title> or <alt> to get the effect of a tooltip,
where the page author controls the line breaks?
If yes, could somebody send an example of how to do it?
I'm interested in recent versions of IE and Netscape/Mozilla.
Thanks in advance.
Jul 20 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a

"mitch gart" <mg***@kronos.com> wrote in message
news:5e**************************@posting.google.c om...
Is it possible to insert newlines, or some other character,
into <title> or <alt> to get the effect of a tooltip,


The <title> is what typically appears in your browser caption. There is no
such thing as <alt>.

If you're asking about the title and alt *attributes*, I don't know what IE
or Mozilla *do*, but the values are these attributes are supposed to be of
type CDATA, the legal characters from the document character set. Embedded
line feeds are supposed to be ignored, and carriage returns are supposed to
be converted to a single space.

If you want to experiment with what actually happens in a particular
browser, feel free to try any of the following and see if it produces a new
line in your tooltip. I'm skeptical, but you never know.



\0A
\r
\n
<br>

Also: the alt attribute is not intended to produce a tooltip. AFAIK only IE
among current browser versions does produce one; Netscape 6 and onward
don't.

Jul 20 '05 #2

P: n/a
"Harlan Messinger" <h.*********@comcast.net> wrote:
If you're asking about the title and alt *attributes*, I don't know
what IE or Mozilla *do*,


It depends on the browser. IE incorrectly honors line breaks. As a rule
of thumb, use short alt and title attribute values to avoid problems.
More on this (discussing specifically alt, but similar considerations
apply to title attributes):
http://www.cs.tut.fi/~jkorpela/html/alt.html#length

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Jul 20 '05 #3

P: n/a
"Jukka K. Korpela" <jk******@cs.tut.fi> a écrit dans le message de
news:Xn*****************************@193.229.0.31
More on this (discussing specifically alt, but similar
considerations apply to title attributes):
http://www.cs.tut.fi/~jkorpela/html/alt.html#length


I was surprised erading this page, in particular wondering why a alt
attribute could contain a long text ?

As I undestand it, alt should contain a replacement string, as longdesc
should contain the picture's description. Am I wrong, did I miss somthing ?

Jul 20 '05 #4

P: n/a
"Harlan Messinger" <h.*********@comcast.net> a écrit dans le message de
news:2i************@uni-berlin.de
Also: the alt attribute is not intended to produce a tooltip.


Yes, good to notice. The title attribute works really fine for that in
almost any browser (if you limit its use to tha A elements)

Jul 20 '05 #5

P: n/a
"Pierre Goiffon" <pg******@nowhere.invalid> wrote:
I was surprised erading this page, in particular wondering why a alt
attribute could contain a long text ?
For the practical reasons I describe on my page, including the line break
problems. When the text is long, you run into problems whether you use
line breaks in the source or not.
As I undestand it, alt should contain a replacement string,
Correct. For example, if the image is an organization chart, the alt text
should be a textual description of the organization. It is possible to
write such a long alt text, and e.g. Lynx supports it pretty well, but it
won't work reasonably on typical graphic browsers with images off, for
example. Besides, you would probably want to use markup, such as <ul>, in
describing the organization, and you can't use markup inside an
attribute. Thus, it is best to refer to the description with a link.
Then the alt text can be short, perhaps alt="" (depending on how you
present other things).
as longdesc should contain the picture's description.


The longdesc attribute is vaguely defined that way. Its practical meaning
is very small. If a long description is needed (or deemed useful), use a
normal link to it near the image.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Jul 20 '05 #6

P: n/a
Pierre Goiffon wrote:
Yes, good to notice. The title attribute works really fine for that in
almost any browser (if you limit its use to tha A elements)


You do not need to limit to the <a> element. In my experience it
works just fine for most elements. AFAIK, the only elements IE refuses
to display the tool tip for is <abbr>, and <option>. For everything
else, it should work as expected.

--
Lachlan Hunt
http://www.lachy.id.au/
la**********@lachy.id.au.update.virus.scanners

Remove .update.virus.scanners to email me,
NO SPAM and NO VIRUSES!!!

Jul 20 '05 #7

P: n/a

"Lachlan Hunt" <la**********@lachy.id.au.update.virus.scanners> wrote in
message news:_B***************@news-server.bigpond.net.au...
Pierre Goiffon wrote:
Yes, good to notice. The title attribute works really fine for that in
almost any browser (if you limit its use to tha A elements)
You do not need to limit to the <a> element. In my experience it
works just fine for most elements. AFAIK, the only elements IE refuses
to display the tool tip for is <abbr>,


Not so: IE also refuses to display the tool tip for <xypn>, <sss>,
<oi3lso3nd>, and so forth. :-) OK, I'll let you in on the joke: IE refuses
to display a tool tip for <abbr> because <abbr> is absent from IE's HTML
repertoire. Therefore, IE treats it just like the genuinely bogus tags I
listed.
and <option>. For everything
else, it should work as expected.


Jul 20 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.