html - 你如何强制在 css/html 中的单词之间换行?

标签 html css word-break

我在 <p> 中只有一段普通的文字<div> 内的标签标签。但只有 Firefox 能正确显示它。

Firefox 打破了单词之间的线条。所有其他浏览器都会在字中间换行,这使得阅读变得困难。

这是我的意思的一个例子:

Firefox(工作):

This was busy in it was I was here. Let 
him as being within eight by their 
graves, to go down upon her to be a 
dozen directly. So, leaving word 
following, poor mother, of other man, 
and my finger on his blue flag, and the 
habit of tea on a bit. I might feel 
very sorry there is rich, too; late of 
his deepest voice...

所有其他浏览器(IE5-8、safari、chrome)(不工作:)

This was busy in it was I was here. Le
t him as being within eight by their g
raves, to go down upon her to be a doz
en directly. So, leaving word followin
g, poor mother, of other man, and my f
inger on his blue flag, and the habit 
of tea on a bit. I might feel very sor
ry there is rich, too; late of his dee
pest voice...

如何使它适用于所有浏览器?

最佳答案

在您的 css 中的某个地方,您可能有 word-wrap: break-word。找到它并将其更改为 word-wrap: normal(或者干脆完全删除 word-wrap 元素)。

关于html - 你如何强制在 css/html 中的单词之间换行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2259688/

相关文章:

javascript - 在 Javascript 中使用 "this"

css - div高度不符合内容高度

css - 将 SVG 后跟标点符号视为一个词

html - 设置 min-width float until max-width 和分词文本

html - CSS,文本溢出表格单元格

html - 使表内的列组大小相等

javascript - 如何访问复杂的 JSON

html - 使文本框和文本区域更长

html - 页眉和页脚冲突

javascript - 模态警报但确认按钮对脚本没有反应