Click here to get back home

splitting long attribute values

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
splitting long attribute values =?iso-8859-2?Q?K=F8i=B9tof_=AE 02-16-2007
Get Chitika Premium
Posted by =?iso-8859-2?Q?K=F8i=B9tof_=AE on February 16, 2007, 10:05 pm
Please log in for more thread options


How do I split a title attribute value into lines within the source code =

so that the paragraph gets reassembled by the browser when it is being =
displayed?
Microsoft Internet Explorer 7 preserves my line breaks and it is not =
what I want.
The only workaround is to leave a long line in the source code.
I thought a well behaved language should provide a way to fit reasonable =
code into 80 columns of width.
Chris

Posted by Jukka K. Korpela on February 17, 2007, 4:44 am
Please log in for more thread options


Scripsit Křištof Želechovski:

> How do I split a title attribute value into lines within the source
> code so that the paragraph gets reassembled by the browser when it is
> being displayed?

You can't, and it's not a paragraph but just a string of text. If it's as
long as a paragraph, it is almost certainly too long. In fact, if it's
longer than 50 characters (which is common limit on line length in rendering
of title attribute values by browsers), it's probably too long. Quite
possible, you shouldn't be using a title attribute at all but move the text
into content proper. As usual, a URL would let us see what the problem
really is.

Irrespectively of the display problems you mention, there's the problem that
the title text appears
a) for a few seconds only, making it hard to read, especially to people with
minor (or major) reading problems
b) in a rather small font (and although this can be changed by the user,
most users have no idea of this).

> Microsoft Internet Explorer 7 preserves my line breaks and it is not
> what I want.

It's against the specifications, which say that whitespace in an attribute
value is equivalent to a space, but what can you do? Right, you can shorten
the attribute value or move it to content.

In very special cases, you might consider creating a "tooltip" effect using
CSS (and possibly JavaScript).

> The only workaround is to leave a long line in the source code.

That would make browsers of the Netscape/Mozilla clan to display the value
as one very long string or truncate it some some length.

> I thought a well behaved language should provide a way to fit
> reasonable code into 80 columns of width.

A well-behaving markup language would not put content into attributes at
all. Attributes are supposed to specify properties of attributes, not to
carry secondary content.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/


Posted by David E. Ross on February 17, 2007, 11:24 am
Please log in for more thread options


Jukka K. Korpela wrote [in part]:
> Scripsit Křištof Želechovski [also in part]:
>
>> How do I split a title attribute value into lines within the source
>> code so that the paragraph gets reassembled by the browser when it is
>> being displayed?

>> The only workaround is to leave a long line in the source code.
>
> That would make browsers of the Netscape/Mozilla clan to display the value
> as one very long string or truncate it some some length.

This WAS a bug in the Gecko rendering engine. Gecko has been corrected
and incorporated into the latest versions of Firefox and SeaMonkey.

Long tooltips (e.g., from "title" attributes) now split into multiple
lines. Longer tooltips also seem to persist long enough to be read.

However, as already noted, tooltips should not be used for content.

--

David E. Ross
<http://www.rossde.com/>

I use SeaMonkey as my Web browser because I want
a browser that complies with Web standards. See
<http://www.mozilla.org/projects/seamonkey/>.

Posted by Jukka K. Korpela on February 17, 2007, 2:50 pm
Please log in for more thread options


Scripsit David E. Ross:

>>> The only workaround is to leave a long line in the source code.
>>
>> That would make browsers of the Netscape/Mozilla clan to display the
>> value as one very long string or truncate it some some length.
>
> This WAS a bug in the Gecko rendering engine. Gecko has been
> corrected and incorporated into the latest versions of Firefox and
> SeaMonkey.

Using Firefox 2.0 and I still see the title attribute truncated, though now
with an ellipsis sign "..." at the end of the displayed value, so it at
least gives a hint about the truncation. (More exactly, I'm using Firefox
2.0.0.1, which identifies itself as "Mozilla/5.0 (Windows; U; Windows NT
5.1; fi; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1".

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/


Posted by David E. Ross on February 17, 2007, 8:05 pm
Please log in for more thread options


Jukka K. Korpela wrote:
> Scripsit David E. Ross:
>
>>>> The only workaround is to leave a long line in the source code.
>>> That would make browsers of the Netscape/Mozilla clan to display the
>>> value as one very long string or truncate it some some length.
>> This WAS a bug in the Gecko rendering engine. Gecko has been
>> corrected and incorporated into the latest versions of Firefox and
>> SeaMonkey.
>
> Using Firefox 2.0 and I still see the title attribute truncated, though now
> with an ellipsis sign "..." at the end of the displayed value, so it at
> least gives a hint about the truncation. (More exactly, I'm using Firefox
> 2.0.0.1, which identifies itself as "Mozilla/5.0 (Windows; U; Windows NT
> 5.1; fi; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1".
>

I'm using
        Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.2pre)
        Gecko/20070111 SeaMonkey/1.1

The bug was #45375. Without looking it up for my previous reply, I
thought it would be a "Core" bug, affecting all Mozilla-based browsers.
However, it was a "Mozilla Suite" (SeaMonkey) bug, which is now fixed.

The corresponding Firefox bug is #218223, which is still not fixed more
than three years after it was written (well more than six years after
the Mozilla Suite bug was written). See
<https://bugzilla.mozilla.org/show_bug.cgi?id=45375>.

It's bugs like this one that keep me on SeaMonkey rather than Firefox.

--

David E. Ross
<http://www.rossde.com/>

I use SeaMonkey as my Web browser because I want
a browser that complies with Web standards. See
<http://www.mozilla.org/projects/seamonkey/>.

Similar ThreadsPosted
Class attribute values November 7, 2005, 7:27 am
sending hidden values AND option values at the same time ? September 12, 2006, 12:52 am
Splitting image at page break disappears when printing. September 30, 2004, 4:24 pm
Very Long Select !!! May 10, 2006, 2:13 am
Make a sinlge long doc out of many December 1, 2007, 11:05 am
Long URLs giving GET problems January 28, 2005, 5:27 pm
Long navigation alternatives, to frames November 22, 2005, 5:50 am
how to wrap this single long name in a table? April 5, 2006, 10:20 am
Have a very long select element repeated August 22, 2007, 12:59 am
How long should I make my web page's Title, Description, & Keywords Meta Tag? July 24, 2007, 11:34 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap