newline in firefox alt / title

Discussion in 'HTML' started by geradeaus, Apr 14, 2005.

  1. geradeaus

    geradeaus Guest


    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 :

    Thanks in advance,
    geradeaus, Apr 14, 2005
    1. Advertisements

  2. Toby Inkster

    Toby Inkster Guest

    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:

    Toby A Inkster BSc (Hons) ARCS
    Contact Me ~
    Toby Inkster, Apr 14, 2005
    1. Advertisements

  3. "geradeaus" <> 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?

    Pages about Web authoring:
    Jukka K. Korpela, Apr 15, 2005
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andreas Klemt
    Steve C. Orr, MCSD
    Aug 10, 2003
  2. Suzanne Knapp

    alt and title in <img> tag?

    Suzanne Knapp, Jul 4, 2005, in forum: HTML
    Blinky the Shark
    Jul 5, 2005
  3. entrepreneur

    Using ALT And TITLE Attributes

    entrepreneur, Oct 26, 2006, in forum: HTML
    Jukka K. Korpela
    Oct 28, 2006
  4. GreatArtist

    alt vs title in explorer 7 & firefox

    GreatArtist, Jul 8, 2007, in forum: HTML
    Andy Dingley
    Jul 17, 2007
  5. zig

    extend alt/title time?

    zig, Jan 31, 2004, in forum: Javascript
    Jim Ley
    Feb 1, 2004

Share This Page