A 'non-breaking dash' please?
Thursday, 16 Oct 2008Yesterday I got myself in a fight with a minus -. Browsers will regard a minus as an excellent opportunity to softbreak your content. So guess what happens if you want to squeeze a negative number (say -19,95) in a small table cell? It appears as
- 19,95which is obviously not what was intended. We all know about the non-breaking space , so I started to wonder: "Is there also a non-breaking dash?". Turns out I was actually looking for the "non-breaking hyphen":
‑A universe of wonderful online typographic possibilites was revealed to me by this great article from A list Apart. It's a much bookmarked article, and I understand why: there is just a truly miraculous amount of alternatives for our common dashes, spaces and quotes.
Posted in: webdesign typography



Comments (4)
td.cellThatWontSoftbrakeMyContent{
white-space:nowrap;
}
doesnt work ?
–
Useful when writing an interval, e.g. "It will be done in 2–3 weeks".
In the meanwhile, you really should be doing as many other editors do (it's done all over Wikipedia). You surround your dashed expressions in HTML/CSS that forces them not to wrap. Check out things like:
http://en.wikipedia.org/wiki/Wikipedia:Line_break_handling
http://en.wikipedia.org/wiki/Template:Nowrap_begin
http://en.wikipedia.org/wiki/Template:Nowrap
For examples of non-wrapping/breaking implementations (made "simpler" through Wikimedia templates).