【发布时间】: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