如何强制只在css / html中的单词之间换行符? [英] How do you force line breaks between words only in css/html?

查看:223
本文介绍了如何强制只在css / html中的单词之间换行符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在< div> 内的< p> 标签。但只有Firefox才能正确显示它。

I have just a regular piece of text in a <p> tag inside a <div> tag. But only Firefox displays it correctly.

Firefox打破了单词之间的界限。所有其他浏览器打破了中间字的界限,这使得它很难阅读。

Firefox breaks the lines between the words. All other browsers break the line mid-word which makes it difficult to read.

以下是我的意思的例子:

Here is an example of what I mean:

Firefox(工作):

Firefox (working):

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)(不工作:)

All other browsers (IE5-8, safari, chrome) (not working:)

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...

我如何为所有人浏览器?

How do I make this work for all browsers?

推荐答案

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

Somewhere in your css you probably have word-wrap: break-word. Find it and change it to word-wrap: normal (or simply remove the word-wrap element altogether).

这篇关于如何强制只在css / html中的单词之间换行符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆