CSS 如何在 Google Chrome 浏览器中使用连字符?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/32094626/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-30 11:24:48  来源:igfitidea点击:

How can I use hyphenation in Google Chrome browser?

cssgoogle-chromecss-hyphens

提问by cypher75

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

我使用以下 css 在我的网站中自动设置连字符文本:

-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!

但在 chrome 中这没有效果。我已经读过,那个 chrome 不支持这个。chrome 中的断字有什么解决方法吗?谢谢!

采纳答案by kaosmos

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

Chrome 目前仅在 Android 和 macOS 上支持断字(并且只有“自动”值),正如您在此处看到的:http: //caniuse.com/#search=hyphens

I used Hyphenatortoo, as suggested by Eric.

正如 Eric 所建议的,我也使用了Hyphenator

回答by tfont

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

软连字符可以与 JavaScript(最佳解决方案)或任何服务器端语言一起应用,但是,用它自己的答案来回答这个问题。