CSS Hyphenation Language

Is it possible to determine the language used for -webkit-hyphens:auto ? Is the default system language used?

 <p style="-webkit-hyphens:auto" lang="en"> Hyphenated in English </p> <p style="-webkit-hyphens:auto" lang="es"> Hyphenated en Español </p> 

According to the Mozilla documentation, the hyphens property will use the language specified in the HTML lang attribute. However, I cannot find a mention of the -webkit-hyphens in the Safari documentation .

Also, does the meta language attribute have any effect? Or can this be applied to the html element?

Here's the fiddle I use for testing (in Safari and Firefox).

+8
html css safari webkit
source share
1 answer

Is it possible to determine the language used for -webkit-hyphens:auto ?

Yes.

However, I cannot find mention of the -webkit-hyphens in the Safari documentation.

In accordance with the change in webkit, it allows you to specify the language.

https://bugs.webkit.org/show_bug.cgi?id=43467

You may need to use -webkit-hyphenate-locale to make it work.

Or can this be applied to the html element?

According to this post and its examples, you can set the lang attribute directly in the element.

http://drublic.de/blog/css3-auto-hyphenation-for-text-elements/

+8
source share

All Articles