Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > newline in firefox alt / title

Reply
Thread Tools

newline in firefox alt / title

 
 
geradeaus
Guest
Posts: n/a
 
      04-14-2005
Hi,

I was wondering how I can solve the following :

when i use line breaks in the title ort alt attribute in firefox, I'll get
weird-signs. In internet explorer it works, only firefox let's me down:

Sample code :

<img src="steppenwolf.jpg" title="Nl : steppenwolf\nEn : Wolfman">

You can view the image how it is displayed in Firefox 1.0.2 (windows xp)
here : http://www.multimedium.be/firefoxtitle.gif

Thanks in advance,
Ben


 
Reply With Quote
 
 
 
 
Toby Inkster
Guest
Posts: n/a
 
      04-14-2005
geradeaus wrote:

> when i use line breaks in the title ort alt attribute in firefox, I'll
> get weird-signs.


There is no way to force line-breaks in tooltips. Try using some sort of
Javascript rollover instead.

Here's an example, which could probably be refined by someone more
knowledgable of Javascript than I:

http://examples.tobyinkster.co.uk/nifty-tips

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

 
Reply With Quote
 
 
 
 
Jukka K. Korpela
Guest
Posts: n/a
 
      04-15-2005
"geradeaus" <(E-Mail Removed)> wrote:

> when i use line breaks in the title ort alt attribute in firefox,
> I'll get weird-signs.


Line breaks work unreliably inside attribute values, and the
specifications are fuzzy on this matter. Avoid them, or at least don't
rely on any particular rendering. Assume that a line break inside
an attribute value should be equivalent to a space but browsers may
get this wrong.

> <img src="steppenwolf.jpg" title="Nl : steppenwolf\nEn : Wolfman">


Several comments:
1. It's invalid markup; the alt attribute is missing. (If you omit it
for brevity, why include the src attribute?)
2. You didn't post the URL of the page where you have the problem.
Do you want to solve the real problem, or the technical problem
you've created in a wrong approach?
3. The string \n is just a string in HTML, with no specific meaning.
You may have meant that some program has such a string in
a print statement. But you didn't say it.
4. The title="..." attribute is advisory only. Don't put anything
there that _needs_ to be communicated to the user.
5. Language changes inside attributes violate accessibility
recommendations, since there is no way to indicate them in markup.
6. Don't abbr more thn u need 2. Spell out language names, unless
there's a good reason to use codes.
7. Are you sure "steppenwolf" is "Wolfman" in English? Which English?

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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
alt vs title in explorer 7 & firefox GreatArtist HTML 196 07-17-2007 12:08 AM
alt.autos.porsche928,rec.humor.oracle.d,alt.balordi.it,alt.computer,sci.med.laboratory . Computer Information 1 06-18-2004 08:44 AM



Advertisments