在IE 7中是否有CSS空白属性的替代品?

前端之家收集整理的这篇文章主要介绍了在IE 7中是否有CSS空白属性的替代品?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

我正在尝试使用带有pre-line值的css white-space属性在div中显示带换行符的文本.这适用于Chrome,Firefox和IE 8,但不适用于IE 7.

例如,

将在Chrome,Firefox和IE 8中显示如下:

CSS has a pretty useful property called white-space that I’m guessing goes unnoticed among CSS beginners.

You can probably live without this property for quite some time,it will come in very handy and you’ll find yourself going back to it over and over again.

但在IE 7中它显示如下:

CSS has a pretty useful property called white-space that I’m guessing goes unnoticed among CSS beginners. You can probably live without this property for quite some time,it will come in very handy and you’ll find yourself going back to it over and over again.

你可以在这里看到它:http://jsfiddle.net/VSQnP/10/.

我已经尝试了pre的值,但是然后文本没有换行并且长行在div的右侧运行,并且预先换行,但是在IE 7中存在相同的问题.

最佳答案
IE7不支持前置空白处理属性.有关兼容性表,请参见此page.

您可以改用这些声明

white-space: pre;
word-wrap: break-word;

它不是pre-line的替代品,因为它破坏了单词而不是行,但至少内容不超过其容器的边界.

原文链接:/css/427279.html

猜你在找的CSS相关文章