css - 自动换行不适用于 Linux

标签 css linux wordpress line-breaks

我目前在一个网站上工作(使用 WordPress)并希望文本在需要的地方使用换行符(因此,当一个长词可以被拆分以使行的词间距看起来足够时)。

在我的主题选项 CSS 中,我定义了以下内容:

p {
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
  -ms-hyphens: auto;
  -moz-hyphens: auto;
}

当使用 Windows 时,这适用于 Mac 和 Firefox,但我的 Linux Firefox 不相应地工作。

我是否遗漏了任何特定于 Linux 的声明?如何实现自动断字?

最佳答案

是否设置了lang-attribute?

<article lang="en">

如果设置了 lang-attribute,则需要在浏览器中实现适当的断字字典。

来自MDN :

On HTML, the language is determined by the lang attribute: browsers will hyphenate only if this attribute is present and if an appropriate hyphenation dictionary is available.

在 Firefox 中这已经在 1 月底实现 ( https://bugzilla.mozilla.org/show_bug.cgi?id=253317 ) 也许它还没有达到 Linux 版本...

关于css - 自动换行不适用于 Linux,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29253492/

相关文章:

html - overflow hidden 的div中的中心图像

html - 从页面上的链接中删除所有下划线?

javascript - 如何在悬停时将元素旋转 180 度超过 150 毫秒?

linux - 在 HTTP 请求上使用 HTTP Keep-alive 的方法

html - 横幅在屏幕调整大小时被压下

css - 如何设置当前页面的 "wp_nav_menu"链接的样式?

javascript - 如果没有调用任何函数,javascript会执行吗?

html - CSS 缩小图像以适应包含的 div,而不指定原始大小

javascript 设置超时();不适用于 linux (firefox)

linux - 无法在 Linux 7 中安装 Oracle 数据库