1

I have a really big word that is just too long for mobile views, I can break it with <wbr> but the rules of this language require an hyphen when a word is separate on two pieces.

Is there a way to say:

thisreally<wbr>longword

must be

thisreally-
longword

when cutted?

distante
  • 6,438
  • 6
  • 48
  • 90
  • Possible duplicate of [Soft hyphen in HTML ( vs. ­)](http://stackoverflow.com/questions/226464/soft-hyphen-in-html-wbr-vs-shy) – Roy Sep 30 '16 at 07:00
  • Could be, but I wasn't aware of the existence of `&shy`, while the other question ask about the difference between the two. – distante Sep 30 '16 at 07:04

2 Answers2

1

You can use &shy; instead:

thisareallyreallyreallyreallyreallyreally&shy;andverylongwordwithashynewline

The <wbr> element doesn't support a new line character like -.
You can find more information about this here: http://www.quirksmode.org/oddsandends/wbr.html

Sebastian Brosch
  • 42,106
  • 15
  • 72
  • 87
0

Try It Once Its Working Fine

a:before {
   content:" - ";
}
<a href="#">CSS-Tricks</a>
Samudrala Ramu
  • 2,088
  • 1
  • 15
  • 36