当我在具有空白属性的textarea中按Enter键设置为通过CSS nowrap时,它是无效的。没有创建新行。插入一个简单的空格。
这仅在IE8中是正确的。我已经尝试了Opera,Chrome和Firefox的当前版本,但是还没有遇到这样的问题。
您对此有解决方案吗?
谢谢..
我有这个:
.gwt-TextArea
{
white-space:nowrap;
}
其中gwt-TextArea设置文本区域。
另外,我试过了
.gwt-TextArea
{
white-space:pre;
}
似乎给出了相同的结果。
最佳答案
This article说Internet Explorer忽略换行符with white-space: nowrap
。
他们的解决方法是使用white-space: pre
。这样可以使您获得想要的行为吗?