Reputation: 11
I have a word that contains "-" in it (pre-balancing) that I don't wont to be separate in two lines.
In Google chrome The word is divided in two lines:
something something something pre-
balancing
and I want it to be:
something something something pre-balancing
or:
something something something
pre-balancing
For other words which don't have "-" works fine. I have this issue only for chrome browser. In all the other browser that I've tested seems to be working fine.
Can anyone help me out with this one?
Upvotes: 1
Views: 966
Reputation: 8264
Wrap a <span>
tag around your long word that contains hyphen. And apply CSS as below.
<p>something <span class="nowrap">pre-balancing<span> something something something</p>
.nowrap {
white-space: nowrap;
}
Or use the non breaking hyphens within HTML: ‑
or ‑
(Although I prefer CSS)
Upvotes: 2