HerrSerker HerrSerker - 1 year ago 100
HTML Question

Chrome doesn't respect Zero Width Joiner

If I create a text, where I got a dash at the start of a word (very common in German language), Google Chrome sets the hyphen at the end of the line and the word at the start of the next line. This is the wrong behavior. It should be the hyphen and the word on one line. Even if I put in a

entity between hyphen and word, it still doesn't work correctly.

In Firefox all is well.

Example here: https://jsfiddle.net/p6dp2hLb/2/

enter image description here

Answer Source

You can use ‑ [Unicode Character 'NON-BREAKING HYPHEN' (U+2011)] as an alphabetical character instead of raw dash character because it has its special meanings in formatting.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download