问题
I want to break a text whit hyphenation, but it brings an error:
It says: "Invlaid property value".
But in many docs they say, that the "auto" value exists!
It should break this text whit hyphenation:
I hope, that someone can help me whit that!
回答1:
To add to their answers to check if you have the right browser at https://caniuse.com/#feat=css-hyphens
You can also check MDN's documentation about it and see how your language dictionary may not be supported yet.
(scroll to the bottom to see Hyphenation dictionary language compatibility) https://developer.mozilla.org/en-US/docs/Web/CSS/hyphens
There is even a footnote that says for Chrome:
No automatic hyphenation, only
-webkit-hyphens: none
is supported.
回答2:
'hyphens' is not supported by Chrome browser
回答3:
If you take a look here http://caniuse.com/#feat=css-hyphens you can see that chrome doesn't really support hyphens.
"Only supported on Android & Mac platforms (and only the "auto" value) for now."
回答4:
Maybe your browser is not supporting it. Check this for browser support
http://caniuse.com/#search=hyphens
Try using browser specific styles
-webkit-hyphens: auto;
-ms-hyphens: auto;
hyphens: auto;
Check this JS fiddle https://jsfiddle.net/api/mdn/
More info here
回答5:
Not all browsers support hyphens: auto which is under CSS Text Module Level 3
For instance Chrome supports only inherit, initial, manual, none and unset with -Webkit- (13). What is the browser your are working with? Check CSS3 browser support for more detail.
来源:https://stackoverflow.com/questions/46314381/css-hyphen-throws-error-invalid-property-value