【问题标题】:Why hyphens property does not work in Chrome为什么连字符属性在 Chrome 中不起作用
【发布时间】:2019-06-11 09:24:12
【问题描述】:

为了适应移动设备平台的可用性,我需要使用 css 属性连字符。但是,此属性似乎不适用于 Chrome。我做错了什么还是有其他解决方案如何克服它?

.title {
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-hyphens: auto;
-ms-hyphens: auto;
hyphens: auto; }

这在 Firefox 和 Safari 中运行良好,但在 Chrome 中却不行。有什么帮助吗?

【问题讨论】:

  • 您的html 标签上有lang 属性吗?这对于连字符是强制性的。另外,根据caniuse.com/#search=hyphensChrome 目前仅支持 Android 和 Mac 上的连字符。
  • 是的,html 标记中的 lang="en"。在 Firefox 和 safari 中完美运行

标签: css google-chrome hyphenation


【解决方案1】:

Chrome 目前仅在 Android 设备和 macOS 上支持连字符,这就是您可能遇到此问题的原因。

进一步参考:http://caniuse.com/#search=hyphens

【讨论】:

    猜你喜欢
    • 2020-02-21
    • 2011-03-15
    • 2020-11-20
    • 2013-11-04
    • 1970-01-01
    • 1970-01-01
    • 2019-02-19
    • 2017-02-16
    • 1970-01-01
    相关资源
    最近更新 更多