html - 标题不会断字

标签 html css

我不确定问题出在哪里,但我的 h1 和 h2 采取的是拆分单词而不是打破断字。

这是我正在处理的网站的链接 https://helium.marketing

我试过在谷歌搜索后手动添加一个片段,但似乎没有任何效果。这是片段。

    p, h1, h2, h3, h4, h5 {
        white-space: pre-wrap;       /* css-3 */
        white-space: -moz-pre-wrap;  /* Mozilla, since 1999 */
        white-space: -pre-wrap;      /* Opera 4-6 */
        white-space: -o-pre-wrap;    /* Opera 7 */
        word-wrap: break-word;       /* Internet Explorer 5.5+ */
    }

最佳答案

问题原来是 white-space: pre-wrap;需要是 white-space: normal;和溢出:可见;

当我在 Chrome 中注入(inject)代码时它没有修复它,但在浏览器刷新时,它解决了问题。谢谢大家!

关于html - 标题不会断字,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56417719/

相关文章:

javascript - 为什么选择文件时此表单不自动提交?

javascript - 如何标记浏览器滚动条?

javascript - 如何通过CSS或javascript给句子赋予句子大小写?

html - 如果屏幕宽度小于特定宽度,则隐藏导航栏的某些链接

html - Angular 7 App 样式在 Safari、Opera 和 IE 中损坏,在 Chrome、Firefox、Vivaldi 和 Edge 中正常

css - 在div中从底部到顶部堆积图像

html - 事件前的下拉显示

html - 删除堆叠的上下框之间的间隙

javascript - 如何制作动画虚线 svg 线?

html - 电子邮件图像不显示 (Gmail)