<acronym> new line

Discussion in 'HTML' started by John, Aug 29, 2007.

  1. John

    John Guest

    Hi

    <acronym title="apple pie custard tart">desserts</acronym>

    Is there any way I could place a line feed after pie so I get

    apple pie
    custard tart

    on two lines

    Regards
    John
    John, Aug 29, 2007
    #1
    1. Advertising

  2. Scripsit John:

    > <acronym title="apple pie custard tart">desserts</acronym>
    >
    > Is there any way I could place a line feed after pie so I get
    >
    > apple pie
    > custard tart
    >
    > on two lines


    What you really want is a line break in the tooltip that you expect browsers
    to show on mouseover. The answer is that you can't achieve that in any
    reliable manner. Putting a line break in the source,

    <acronym title="apple pie
    custard tart">desserts</acronym>

    may make some browsers do what you want, but this is really a browser _bug_.
    It violates HTML rules that say that a line break inside an attribute value
    is equivalent to a space.

    What are you trying to achieve, anyway? The word "desserts" ain't no
    acronym, so <span> would be the proper markup. But tooltips created by title
    attributes are a lousy way of presenting information, except in special
    cases where users can be expected to know about them.

    --
    Jukka K. Korpela ("Yucca")
    http://www.cs.tut.fi/~jkorpela/
    Jukka K. Korpela, Aug 29, 2007
    #2
    1. Advertising

  3. John

    Art Guest

    On 8/29/07 6:10 PM, Jukka K. Korpela wrote:

    > Scripsit John:
    >
    >> <acronym title="apple pie custard tart">desserts</acronym>
    >>
    >> Is there any way I could place a line feed after pie so I get
    >>
    >> apple pie
    >> custard tart
    >>
    >> on two lines

    >
    > What you really want is a line break in the tooltip that you expect browsers
    > to show on mouseover. The answer is that you can't achieve that in any
    > reliable manner. Putting a line break in the source,
    >
    > <acronym title="apple pie
    > custard tart">desserts</acronym>
    >
    > may make some browsers do what you want, but this is really a browser _bug_.
    > It violates HTML rules that say that a line break inside an attribute value
    > is equivalent to a space.
    >
    > What are you trying to achieve, anyway? The word "desserts" ain't no
    > acronym, so <span> would be the proper markup. But tooltips created by title
    > attributes are a lousy way of presenting information, except in special
    > cases where users can be expected to know about them.
    >

    Scripsit John,

    You can try placing an encoded line feed into the title:

    <acronym title="apple pie
    custard tart">

    although this isn't universally recognized by all browsers for
    tool-tips. Firefox, IE, and Safari do. Opera and Seamonkey don't
    (treats it as a space).

    Although the line feed isn't an HTML named entity
    (http://www.w3.org/TR/html401/sgml/entities.html), browsers historically
    have recognized this numerical encoding method.

    Jukka's suggestion of using a <span> element will work. However, unlike
    the <acronym> element, there is no indication to the viewer (no dotted
    underline or other decoration by the browser) that there is anything
    additional information available about this word.

    Thus, a unique CSS style/class would need to be created for these
    <span>'s to flag the user that there is additional information available
    via tool-tip for the word. You could put a global message on your page
    to that effect.

    Art
    Art, Aug 30, 2007
    #3
  4. Art wrote:

    > You can try placing an encoded line feed into the title:
    >
    > <acronym title="apple pie
    custard tart">
    >
    > although this isn't universally recognized by all browsers for
    > tool-tips. Firefox, IE, and Safari do. Opera and Seamonkey don't
    > (treats it as a space).
    >
    > Although the line feed isn't an HTML named entity
    > (http://www.w3.org/TR/html401/sgml/entities.html), browsers historically
    > have recognized this numerical encoding method.


    You didn't try this did you? It isn't recognized at all in a title
    attribute for any browser that I know of including FF and Opera... Now
    on Windows system
    (LF+CR)works with Gecko and IE but not on
    Opera... Doesn't work with FF on Linux but does with Konqueror... spotty
    at best.

    >
    > Jukka's suggestion of using a <span> element will work. However, unlike
    > the <acronym> element, there is no indication to the viewer (no dotted
    > underline or other decoration by the browser) that there is anything
    > additional information available about this word.
    >


    Agree, dessert is not an acronym.

    > Thus, a unique CSS style/class would need to be created for these
    > <span>'s to flag the user that there is additional information available
    > via tool-tip for the word. You could put a global message on your page
    > to that effect.


    Sill idea but CSS popup would work and degrade where the information
    would be availably to the user...

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
    <meta http-equiv="content-language" content="en-us">
    <title>CSS balloon</title>

    <style type="text/css">
    ..balloon { position: relative; border-bottom: 1px dashed #0f0; }
    ..balloon span {
    display: block; position: absolute;
    top: .5em; left: -100em; /* push out of view*/
    border: 1px solid #000; padding: .25em;
    color: #000; background-color: #ffd;
    white-space: nowrap; /* prevent wrapping except where you specify */
    }

    ..balloon { behavior: url(IEFixes.htc); } /* IE hover attachment */
    ..balloon:hover span,
    ..balloon.hover span { left: 1em; } /* move into viewport */

    </style>
    </head>

    <body>
    <p>One way is with a CSS styled element <span class="balloon">
    <span>apple pie<br>custard tart</span>desserts</span>,
    would work. For <span title="12
    345">IE</span> you will have to
    use a bit of JavaScript
    or HTC file hack.
    </p>
    </body>
    </html>


    and the HTC file:

    <public:component>
    // For MSIE use JScript to attach JS functions to compensate
    // for missing pseudo-class support
    // from Vladdy http://www.vladdy.net/Demos/IEPseudoClassesFix.html
    // updated for html4.01 jnl 3/06
    <public:attach event="onmouseover" onevent="DoHover()">
    <public:attach event="onmouseout" onevent="RestoreHover()">
    <public:attach event="onmousedown" onevent="DoActive()">
    <public:attach event="onmouseup" onevent="RestoreActive()">
    <script type="text/jscript">
    function DoHover(){
    element.className += ' hover';
    }
    function DoActive(){
    element.className += ' active';
    }
    function RestoreHover(){
    element.className = element.className.replace(/\shover\b/,'');
    }
    function RestoreActive(){
    element.className = element.className.replace(/\sactive\b/,'');
    }
    </script>
    </public:component>


    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
    Jonathan N. Little, Aug 30, 2007
    #4
  5. Jonathan N. Little wrote:
    > Art wrote:
    >
    >> You can try placing an encoded line feed into the title:
    >>
    >> <acronym title="apple pie
    custard tart">
    >>
    >> although this isn't universally recognized by all browsers for
    >> tool-tips. Firefox, IE, and Safari do. Opera and Seamonkey don't
    >> (treats it as a space).
    >>
    >> Although the line feed isn't an HTML named entity
    >> (http://www.w3.org/TR/html401/sgml/entities.html), browsers
    >> historically have recognized this numerical encoding method.

    >
    > You didn't try this did you? It isn't recognized at all in a title
    > attribute for any browser that I know of including FF and Opera... Now
    > on Windows system
    (LF+CR)works with Gecko and IE but not on
    > Opera... Doesn't work with FF on Linux but does with Konqueror... spotty
    > at best.


    The Windows line separator is CR + LF, not the other way around.
    Harlan Messinger, Aug 30, 2007
    #5
  6. Harlan Messinger wrote:

    > The Windows line separator is CR + LF, not the other way around.


    Yep I got them ass-backwards. Should be
    (CR+LF)
    i.e., 0xD0 0xA0

    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
    Jonathan N. Little, Aug 30, 2007
    #6
  7. Art wrote:
    > On 8/29/07 6:10 PM, Jukka K. Korpela wrote:
    >
    >> Scripsit John:
    >>
    >>> <acronym title="apple pie custard tart">desserts</acronym>
    >>>
    >>> Is there any way I could place a line feed after pie so I get
    >>>
    >>> apple pie
    >>> custard tart
    >>>
    >>> on two lines

    >>
    >> What you really want is a line break in the tooltip that you expect browsers
    >> to show on mouseover. The answer is that you can't achieve that in any
    >> reliable manner. Putting a line break in the source,
    >>
    >> <acronym title="apple pie
    >> custard tart">desserts</acronym>
    >>
    >> may make some browsers do what you want, but this is really a browser _bug_.
    >> It violates HTML rules that say that a line break inside an attribute value
    >> is equivalent to a space.
    >>
    >> What are you trying to achieve, anyway? The word "desserts" ain't no
    >> acronym, so <span> would be the proper markup. But tooltips created by title
    >> attributes are a lousy way of presenting information, except in special
    >> cases where users can be expected to know about them.
    >>

    > Scripsit John,
    >
    > You can try placing an encoded line feed into the title:
    >
    ><acronym title="apple pie
    custard tart">
    >
    > although this isn't universally recognized by all browsers for
    > tool-tips. Firefox, IE, and Safari do. Opera and Seamonkey don't
    > (treats it as a space).


    I'm still trying to figure out why anyone would treat "desserts" as an
    acronym.


    --
    Blinky RLU 297263
    Killing all posts from Google Groups
    The Usenet Improvement Project:
    http://improve-usenet.org <----------- New Site Aug 28
    Blinky the Shark, Aug 30, 2007
    #7
  8. John

    Art Guest

    On 8/30/07 12:16 PM, Jonathan N. Little wrote:

    > Art wrote:
    >
    >> You can try placing an encoded line feed into the title:
    >>
    >> <acronym title="apple pie
    custard tart">
    >>
    >> although this isn't universally recognized by all browsers for
    >> tool-tips. Firefox, IE, and Safari do. Opera and Seamonkey don't
    >> (treats it as a space).
    >>
    >> Although the line feed isn't an HTML named entity
    >> (http://www.w3.org/TR/html401/sgml/entities.html), browsers historically
    >> have recognized this numerical encoding method.

    >
    > You didn't try this did you? It isn't recognized at all in a title
    > attribute for any browser that I know of including FF and Opera... Now
    > on Windows system
    (LF+CR)works with Gecko and IE but not on
    > Opera... Doesn't work with FF on Linux but does with Konqueror... spotty
    > at best.

    Yes :).

    To clarify, the results for Firefox, Opera, Safari, and Seamonkey were
    observed on a Mac. IE6 was observed under W2K. However, I mistakenly
    transcribed the Seamonkey and Firefox results: Works on Seamonkey,
    yields a single space on FF.

    On IE6, the CR is ignored, the LF is sufficient.

    Opera ignores the LF and maps the CR to a space.

    Actually, encoding a LF/CR combination on Safari results in TWO line feeds.

    I saw the same title behavior with both <acronym> and <span>.

    Your results on Linux re-enforces my original statement - this encoding
    isn't universally recognized by all browsers for tool-tips.

    Thus, the LF/CR encoding with either <acronym> or <style> elements would
    satisfy the OP request if the browser and platforms can be limited.

    Not to fan the flames, but the fact that it does work as desired with
    just LF encoding on IE6 on the PC somewhat increases the chance that a
    user will observe the intended results :).

    Art

    >
    >>
    >> Jukka's suggestion of using a <span> element will work. However, unlike
    >> the <acronym> element, there is no indication to the viewer (no dotted
    >> underline or other decoration by the browser) that there is anything
    >> additional information available about this word.
    >>

    >
    > Agree, dessert is not an acronym.
    >
    >> Thus, a unique CSS style/class would need to be created for these
    >> <span>'s to flag the user that there is additional information available
    >> via tool-tip for the word. You could put a global message on your page
    >> to that effect.

    >
    > Sill idea but CSS popup would work and degrade where the information
    > would be availably to the user...
    >
    > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    > "http://www.w3.org/TR/html4/strict.dtd">
    > <html>
    > <head>
    > <meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
    > <meta http-equiv="content-language" content="en-us">
    > <title>CSS balloon</title>
    >
    > <style type="text/css">
    > .balloon { position: relative; border-bottom: 1px dashed #0f0; }
    > .balloon span {
    > display: block; position: absolute;
    > top: .5em; left: -100em; /* push out of view*/
    > border: 1px solid #000; padding: .25em;
    > color: #000; background-color: #ffd;
    > white-space: nowrap; /* prevent wrapping except where you specify */
    > }
    >
    > .balloon { behavior: url(IEFixes.htc); } /* IE hover attachment */
    > .balloon:hover span,
    > .balloon.hover span { left: 1em; } /* move into viewport */
    >
    > </style>
    > </head>
    >
    > <body>
    > <p>One way is with a CSS styled element <span class="balloon">
    > <span>apple pie<br>custard tart</span>desserts</span>,
    > would work. For <span title="12
    345">IE</span> you will have to
    > use a bit of JavaScript
    > or HTC file hack.
    > </p>
    > </body>
    > </html>
    >
    >
    > and the HTC file:
    >
    > <public:component>
    > // For MSIE use JScript to attach JS functions to compensate
    > // for missing pseudo-class support
    > // from Vladdy http://www.vladdy.net/Demos/IEPseudoClassesFix.html
    > // updated for html4.01 jnl 3/06
    > <public:attach event="onmouseover" onevent="DoHover()">
    > <public:attach event="onmouseout" onevent="RestoreHover()">
    > <public:attach event="onmousedown" onevent="DoActive()">
    > <public:attach event="onmouseup" onevent="RestoreActive()">
    > <script type="text/jscript">
    > function DoHover(){
    > element.className += ' hover';
    > }
    > function DoActive(){
    > element.className += ' active';
    > }
    > function RestoreHover(){
    > element.className = element.className.replace(/\shover\b/,'');
    > }
    > function RestoreActive(){
    > element.className = element.className.replace(/\sactive\b/,'');
    > }
    > </script>
    > </public:component>
    >
    >
    Art, Aug 30, 2007
    #8
  9. Art wrote:

    >
    > To clarify, the results for Firefox, Opera, Safari, and Seamonkey were
    > observed on a Mac. IE6 was observed under W2K. However, I mistakenly
    > transcribed the Seamonkey and Firefox results: Works on Seamonkey,
    > yields a single space on FF.
    >
    > On IE6, the CR is ignored, the LF is sufficient.
    >
    > Opera ignores the LF and maps the CR to a space.
    >
    > Actually, encoding a LF/CR combination on Safari results in TWO line feeds.
    >
    > I saw the same title behavior with both <acronym> and <span>.
    >
    > Your results on Linux re-enforces my original statement - this encoding
    > isn't universally recognized by all browsers for tool-tips.
    >
    > Thus, the LF/CR encoding with either <acronym> or <style> elements would
    > satisfy the OP request if the browser and platforms can be limited.


    AFAIK the LF + CR combination isn't the line separator on any operating
    system. The combination you should be testing is CR + LF.
    Harlan Messinger, Aug 30, 2007
    #9
  10. While the city slept, Blinky the Shark () feverishly
    typed...

    [...]
    > I'm still trying to figure out why anyone would treat "desserts" as an
    > acronym.


    <acronym title="Delicious Eclairs, Shortbreads, Sorbets, Extra-Rich Tortes
    and Souffles">desserts</acronym> ;-)

    Cheers,
    Nige

    --
    Nigel Moss http://www.nigenet.org.uk
    Mail address will bounce. | Take the DOG. out!
    "Your mother ate my dog!", "Not all of him!"
    nice.guy.nige, Aug 30, 2007
    #10
  11. John

    Art Guest

    On 8/30/07 2:20 PM, Harlan Messinger wrote:

    > Art wrote:
    >
    >>
    >> To clarify, the results for Firefox, Opera, Safari, and Seamonkey were
    >> observed on a Mac. IE6 was observed under W2K. However, I mistakenly
    >> transcribed the Seamonkey and Firefox results: Works on Seamonkey,
    >> yields a single space on FF.
    >>
    >> On IE6, the CR is ignored, the LF is sufficient.
    >>
    >> Opera ignores the LF and maps the CR to a space.
    >>
    >> Actually, encoding a LF/CR combination on Safari results in TWO line feeds.
    >>
    >> I saw the same title behavior with both <acronym> and <span>.
    >>
    >> Your results on Linux re-enforces my original statement - this encoding
    >> isn't universally recognized by all browsers for tool-tips.
    >>
    >> Thus, the LF/CR encoding with either <acronym> or <style> elements would
    >> satisfy the OP request if the browser and platforms can be limited.

    >
    > AFAIK the LF + CR combination isn't the line separator on any operating
    > system. The combination you should be testing is CR + LF.

    My results with CR/LF are the same with the exception that on Safari
    either a CR or CR/LF sequence does result in two lines of text where
    LF/CR resulted in one line, a blank line and a the second line.

    FWIW - The Mac uses CR as a line separator in text files. AFAIK,
    Unix/Linux uses LF, Windoze uses the CR/LF combination.
    Art, Aug 30, 2007
    #11
  12. nice.guy.nige wrote:
    > While the city slept, Blinky the Shark () feverishly
    > typed...
    >
    > [...]
    >> I'm still trying to figure out why anyone would treat "desserts" as an
    >> acronym.

    >
    ><acronym title="Delicious Eclairs, Shortbreads, Sorbets, Extra-Rich Tortes
    > and Souffles">desserts</acronym> ;-)


    Oh yeah, I forgot about that... :)


    --
    Blinky RLU 297263
    Killing all posts from Google Groups
    The Usenet Improvement Project:
    http://improve-usenet.org <----------- New Site Aug 28
    Blinky the Shark, Aug 31, 2007
    #12
  13. John

    John Guest

    Hi, all

    Many thanks for the many replies.

    Yes, I know, desserts is not an acronym . It was just an example. Don't
    get excited it's only for fun.

    Now, the &13;&10; work well in IE but not in FF. So I'm half way there.
    The site should work in both.
    Other browsers I don't really care about.

    Is <acronym> the best to use? In this case it is.

    Many thanks, again, folks.

    Regards
    John
    John, Aug 31, 2007
    #13
  14. John wrote:
    > Hi, all
    >
    > Many thanks for the many replies.
    >
    > Yes, I know, desserts is not an acronym . It was just an example. Don't
    > get excited it's only for fun.


    Who's excited?


    --
    Blinky RLU 297263
    Killing all posts from Google Groups
    The Usenet Improvement Project:
    http://improve-usenet.org <----------- New Site Aug 28
    Blinky the Shark, Aug 31, 2007
    #14
  15. Scripsit John:

    > Many thanks for the many replies.


    Unfortunately it seems that you have missed or ignored most of their best
    content.

    > Yes, I know, desserts is not an acronym . It was just an example.


    When you present an example, a manifestly bad example is usually
    symptomatic - a good example of what you're doing, though.

    > Now, the &13;&10; work well in IE but not in FF.


    The character references, when written correctly, denote a line break, which
    is incorrectly treated by IE as causing a line break in visual rendering and
    treated correctly as equivalent to a space by FF, and treated in various
    confusing and partly funny ways by some older browsers.

    It's no different from an actual line break, except that it may look like
    cool technospeak and obfuscates your markup a bit.

    I actually explained this already, in somewhat different words.

    > So I'm half way there.


    What should you do if you are half way digging yourself down into a deep
    hole?

    > Other browsers I don't really care about.


    Such as IE 8, which may well fix the current IE bug, right?

    > Is <acronym> the best to use? In this case it is.


    Of course not. Especially if you have to ask, <acronym> is not the right
    element.

    If you just want to entertain yourself with tiny popup windows on mouseover,
    on both of the browsers you know, then use a piece of CSS and JavaScript (or
    maybe just CSS), giving you _much_ better options. Then there's no reason to
    use <acronym> of course. You can use <a>, it's faster to type!

    If you wish to present some content in a useful way, it's a different story,
    and you haven't even started telling about it yet.

    --
    Jukka K. Korpela ("Yucca")
    http://www.cs.tut.fi/~jkorpela/
    Jukka K. Korpela, Aug 31, 2007
    #15
  16. John

    Guest

    <acronym>title="apple pie<br>custard tarts<br>desserts"</acronym>
    , Aug 31, 2007
    #16
  17. wrote:
    > <acronym>title="apple pie<br>custard tarts<br>desserts"</acronym>
    >


    Firstly, PLAIN TEXT for newsgroups please.

    Secondly, your suggestion will not work as you expect, HTML markup will
    not be interpreted within an attribute value so you will get a tooltip
    with literally "apple pie<br>custard tarts<br>desserts" and not new lines.

    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
    Jonathan N. Little, Aug 31, 2007
    #17
    1. Advertising

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. Fred
    Replies:
    2
    Views:
    587
    Toby A Inkster
    Jul 17, 2003
  2. Steven

    <abbr> = <acronym>?

    Steven, Dec 10, 2003, in forum: HTML
    Replies:
    37
    Views:
    1,275
    Mark Parnell
    Dec 28, 2003
  3. kayodeok
    Replies:
    13
    Views:
    630
    Mark Parnell
    Mar 1, 2004
  4. Rowan Malin
    Replies:
    10
    Views:
    1,067
    Foofy (formerly known as Spaghetti)
    May 14, 2004
  5. Marcus Stollsteimer

    <abbr> and <acronym>

    Marcus Stollsteimer, Feb 13, 2006, in forum: HTML
    Replies:
    44
    Views:
    1,554
    Neredbojias
    Feb 18, 2006
Loading...

Share This Page