You are here: Re: <acronym> new line « HTML « IT news, forums, messages
Re: <acronym> new line

Posted by Art on 08/30/07 15:19

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&#10;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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация