How can I use hyphenation in Google Chrome browser?

41.6k views Asked by At

I use the following css to auto hyphen text in my website:

-webkit-hyphens: auto;
-moz-hyphens: auto;
-ms-hyphens: auto;
hyphens: auto;

But in chrome this has no effect. I already read, that chrome doesn't support this. Is there any workaround for hyphenation in chrome? Thanks!

3

There are 3 answers

3
kaosmos On BEST ANSWER

Hyphenation is currently supported on Chrome only on Android and macOS (and only the "auto" value), as you can see here: http://caniuse.com/#search=hyphens

I used Hyphenator too, as suggested by Eric.

0
ToddPadwick On

In case anyone else made the mistake I did, hyphens only work if you declare the language in the HTML tag. For example: <html lang="en-GB">

Without a language declared hyphens:auto will do nothing.

1
tfont On

Soft hyphens can be applied with JavaScript (best solution) or any server-side language, however, that answers the question with its own answer.