By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,537 Members | 2,172 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,537 IT Pros & Developers. It's quick & easy.

splitting long attribute values

P: n/a
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
Feb 17 '07 #1
Share this Question
Share on Google+
7 Replies


P: n/a
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/

Feb 17 '07 #2

P: n/a
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/>.
Feb 17 '07 #3

P: n/a
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/

Feb 17 '07 #4

P: n/a
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/>.
Feb 18 '07 #5

P: n/a

U┐ytkownik "Jukka K. Korpela" <jk******@cs.tut.finapisa│ w wiadomoÂci news:_7******************@reader1.news.saunalahti. fi...
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).
As far as I can understand, the title serves as a reminder only;
the information contained in the tool tip is also available as plain text elsewhere.
I made the reminder as short as it can be, it cannot be any shorter because it is written in parrotspeak
(and the whole document is of legal nature).
>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
I can complain about it loudly to Microsoft. But I am not sure it is really specified this way.
Is the specification in ISO 8879 or something?
I thought the following paragraph of the HTML 3.2 Reference Specification applied to free text only:

Except within literal text (e.g. the PRE element), HTML treats contiguous sequences of white space characters as being equivalent to a single space character (ASCII decimal 32).

Or is contiguous white space characters reduced to one in attribute values also?
What about inline scripts? Or event handlers? What should I get with onClick="window.alert('A Z')"?

Thanks
Chris
Feb 18 '07 #6

P: n/a
Scripsit K°i╣tof «elechovski:
As far as I can understand, the title serves as a reminder only;
That's the general idea, "advisory title".
the information contained in the tool tip is also available as plain
text elsewhere.
You could make the text a link to that information, perhaps with a title
attribute with a fairly short value - as a quick reminder.
I made the reminder as short as it can be, it cannot be any shorter
because it is written in parrotspeak
(and the whole document is of legal nature).
Does it have to be in parrotspeak, and what good does it do then?
>>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

I can complain about it loudly to Microsoft.
Well, yes, but they will routinely ignore that. Note that although this
particular behavior violates the specs, they could comply with the specs by
ignoring the title attributes entirely (there is no requirement that they be
displayed at all), truncate them, display them on one line, or whatever.
But I am not sure it is
really specified this way.
Is the specification in ISO 8879 or something?
Technically, yes, in clause 7.9.3, which says: "An attribute value literal
is interpreted as an attribute value by replacing references within in,
ignoring Ee and RS, and replacing an RE or SEPCHAR with a SPACE."
This standardese isn't smooth reading, but "RS" is the SGML concept that
corresponds to end of line (and SEPCHAR is what we know as the tab
character).
Or is contiguous white space characters reduced to one in attribute
values also?
There is no rule on that in SGML or in HTML, as far as I can see.

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

Feb 18 '07 #7

P: n/a
I have just found out that you have explained and documented everything in detail here:
http://www.cs.tut.fi/~jkorpela/html/alt.html
(I succeeded in finding it at last because I specified the correct keyword "white space" instead of that "splitting" of mine)
Thanks a lot
Chris
U┐ytkownik "Jukka K. Korpela" <jk******@cs.tut.finapisa│ w wiadomoÂci news:Fr******************@reader1.news.saunalahti. fi...
Scripsit K°i╣tof «elechovski:
>As far as I can understand, the title serves as a reminder only;
That's the general idea, "advisory title".
>the information contained in the tool tip is also available as plain
text elsewhere.
You could make the text a link to that information, perhaps with a title
attribute with a fairly short value - as a quick reminder.
>I made the reminder as short as it can be, it cannot be any shorter
because it is written in parrotspeak
(and the whole document is of legal nature).
Does it have to be in parrotspeak, and what good does it do then?
>>>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

I can complain about it loudly to Microsoft.
Well, yes, but they will routinely ignore that. Note that although this
particular behavior violates the specs, they could comply with the specs by
ignoring the title attributes entirely (there is no requirement that they be
displayed at all), truncate them, display them on one line, or whatever.
>But I am not sure it is
really specified this way.
Is the specification in ISO 8879 or something?
Technically, yes, in clause 7.9.3, which says: "An attribute value literal
is interpreted as an attribute value by replacing references within in,
ignoring Ee and RS, and replacing an RE or SEPCHAR with a SPACE."
This standardese isn't smooth reading, but "RS" is the SGML concept that
corresponds to end of line (and SEPCHAR is what we know as the tab
character).
>Or is contiguous white space characters reduced to one in attribute
values also?
There is no rule on that in SGML or in HTML, as far as I can see.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/
Mar 16 '07 #8

This discussion thread is closed

Replies have been disabled for this discussion.