newline in firefox alt / title

G

geradeaus

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
 
J

Jukka K. Korpela

geradeaus said:
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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top