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
like

(2R,6S,2'S)-6-methoxy-2-(6-methoxy-3-oxo-3,6-dihydro-2H-pyran-2-ylmethyl)-1-
(toluene-4-sulfonyl)-1,6-dihydro-2H-pyridin-3-one

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
span.sh {
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
NCBI/IEB NLM NIH
[EMAIL-REMOVED]
(301) 43-55932

______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7
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: