Previous Message
Next Message

IE6 breaks words after a question mark

Sent by Jukka K. Korpela on 1 November 2004 14:02


On Mon, 1 Nov 2004, martijnw wrote:

> > <div>Thisisaverylongwordwitha?initwhichbreaksininternetexplorer</div>
>
> IE6 breaks that word after the ? mark.

Yes, if the entire string doesn't fit in.

> I don't know if that's legal (probably not I guess),

There's no authoritative statement on this in W3C specifications, but the
common trend within the W3C is to favor Unicode line breaking rules, which
allow a line break after "?" in this context, for example.

> but it could be useful sometimes.

Certainly. And nasty at other times, e.g. when you try to write about
"?xml" or "http://foo.example/search?bar".

To prevent line breaking using CSS, you would use
div { white-space: nowrap; }
and then you would have the problem that the content overflows, and IE
does that wrong too. Instead of letting the content appear outside the
element's box, IE expands (widens) the box. This might sometimes be what
you want, but then you have problems with the browsers that get this thing
_right_!

You can also use <div><nobr>...</nobr></div>, which is nonstandard HTML
but works widely - even when CSS is not enabled.

> Is this somewhere explained at the w3c-site?

Not in any recommendation, as far as I know. But e.g.
http://www.w3c.org/International/tests/
contains line breaking tests with annotations that describe Unicode line
breaking as "expected" behavior.

It's been discussed on the www-style list, in the context of defining line
breaking rules for CSS 3.

> Which characters are
> allowed to break a word?

A very broad and complex question, but on the practical side, you probably
have problems with the following characters mostly:
-()[]{}=AB=BB%=B0=B7\/!?
Generally anything but normal letters digits and common punctuation in
normal prose text contexts may cause trouble. You won't have problems with
"foo (bar)" but you have a problem with "foo(bar)" (when it's not a typo
but an expression like calling function foo with argument bar).

More on this:
http://www.cs.tut.fi/~jkorpela/html/nobr.html

--=20
Jukka "Yucca" Korpela, http://www.cs.tut.fi/~jkorpela/

______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Previous Message
Next Message

Message thread: