newline inside <title>

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • mitch gart

    newline inside <title>

    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.
  • Harlan Messinger

    #2
    Re: newline inside &lt;title&gt ;


    "mitch gart" <mgart@kronos.c om> wrote in message
    news:5e01a994.0 406080922.1db6b 66a@posting.goo gle.com...[color=blue]
    > Is it possible to insert newlines, or some other character,
    > into <title> or <alt> to get the effect of a tooltip,[/color]

    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.

    Comment

    • Jukka K. Korpela

      #3
      Re: newline inside &lt;title&gt ;

      "Harlan Messinger" <h.messinger@co mcast.net> wrote:
      [color=blue]
      > If you're asking about the title and alt *attributes*, I don't know
      > what IE or Mozilla *do*,[/color]

      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):


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

      Comment

      • Pierre Goiffon

        #4
        Re: newline inside &lt;title&gt ;

        "Jukka K. Korpela" <jkorpela@cs.tu t.fi> a écrit dans le message de
        news:Xns9502D56 758EBDjkorpelac stutfi@193.229. 0.31[color=blue]
        > More on this (discussing specifically alt, but similar
        > considerations apply to title attributes):
        > http://www.cs.tut.fi/~jkorpela/html/alt.html#length[/color]

        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 ?

        Comment

        • Pierre Goiffon

          #5
          Re: newline inside &lt;title&gt ;

          "Harlan Messinger" <h.messinger@co mcast.net> a écrit dans le message de
          news:2imbh4Fon6 6pU1@uni-berlin.de[color=blue]
          > Also: the alt attribute is not intended to produce a tooltip.[/color]

          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)

          Comment

          • Jukka K. Korpela

            #6
            Re: newline inside &lt;title&gt ;

            "Pierre Goiffon" <pgoiffon@nowhe re.invalid> wrote:
            [color=blue]
            > I was surprised erading this page, in particular wondering why a alt
            > attribute could contain a long text ?[/color]

            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.
            [color=blue]
            > As I undestand it, alt should contain a replacement string,[/color]

            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).
            [color=blue]
            > as longdesc should contain the picture's description.[/color]

            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

            Comment

            • Lachlan Hunt

              #7
              Re: newline inside &lt;title&gt ;

              Pierre Goiffon wrote:[color=blue]
              > 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)[/color]

              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

              lachlan.hunt@la chy.id.au.updat e.virus.scanners

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

              Comment

              • Harlan Messinger

                #8
                Re: newline inside &lt;title&gt ;


                "Lachlan Hunt" <lachlan.hunt@l achy.id.au.upda te.virus.scanne rs> wrote in
                message news:_BUxc.404$ sj4.168@news-server.bigpond. net.au...[color=blue]
                > Pierre Goiffon wrote:[color=green]
                > > 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)[/color]
                >
                > 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>,[/color]

                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.
                [color=blue]
                > and <option>. For everything
                > else, it should work as expected.[/color]

                Comment

                Working...