你如何只在css / html中强制换行?

时间:2010-02-14 00:31:48

标签: 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...

如何让这项功能适用于所有浏览器?

2 个答案:

答案 0 :(得分:4)

你css的某个地方你可能有word-wrap: break-word。找到它并将其更改为word-wrap: normal(或者只是简单地删除自动换行元素)。

答案 1 :(得分:2)

对于要自行断开的文本,只需在左侧和右侧添加填充文本的容器(div,td等)。