In the footer of a flexible-layout website I've noticed that IE tends to line-wrap on parenthesis characters (in a phone number in this case). Is there a visually equivalent non-breaking parenthesis, in a similar vein to non-breaking spaces and non-breaking hyphens, that I can use instead?
+5
A:
Try this:
.phone{
white-space: nowrap;
}
<p>Call Customer Support at <span class="phone">+34 (947) 12 34 56 78</span> for further enquiries.</p>
You can do many other things (from <nobr>
tag to certain Unicode chars) but they aren't as cross-browser as this.
Álvaro G. Vicario
2010-04-26 10:47:40
This is a good practical solution, however, I'm specifically looking for a pure html version, for non-css users (accessibility is a priority).
graphicdivine
2010-04-26 11:06:35
This is a minor cosmetic issue. Having an line break in the middle of a phone number is not an accessibility issue.
David Dorward
2010-04-26 15:40:50
@David Dorward That's not the point I was making. My priority is to provide as similar an experience as possbile without CSS. Also, I disagree, I think it *is* an accessibility barrier.
graphicdivine
2010-04-26 17:51:25
You can use `<nobr>` as this answer suggests if you don't want CSS, but I can't think of a single browser alive that doesn't support CSS.
Max Shawabkeh
2010-04-27 05:15:13