Previous Message
Next Message

Don't be ­

Sent by Mark Johnson on 21 March 2006 18:06

I have a question about hyphenation. There's a lot on the Web about
non-breaking hyphenation. I want to be able to get line breaks only at
existing hyphens in words.

I work on a large biomedical database that regularly has long chemical names


If the text has just that name, Explorer, Safari, and Opera 9 line break
the line at hyphens, but Mozilla
doesn't. If I put ­ after each -, Mozilla *still* doesn't
line break it, and IE adds an additional hyphen (as it probably should), so
you get things like 6--
dihydro, etc.

Plus, Mozilla ignores ­. So ­ isn't useful for this.

I do have a solution of sorts. Put <span class="sh"> </span> after
each hyphen in the line, and then define {
color: transparent;
font-size: 0px;

With this approach, everything breaks fine everywhere. This technique
might also be used to get URLs to line break. But it's... icky.

Plus, I'll probably end up doing it in JS for technical reasons.

I can find no -moz- rule that helps with this.

Does anyone have a non-icky solution for this?

Mark Johnson
Systems Analyst/MSD Contractor
(301) 43-55932

css-discuss [EMAIL-REMOVED]]
IE7b2 testing hub --
List wiki/FAQ --
Supported by --
Previous Message
Next Message

Message thread: