【发布时间】:2010-12-15 13:37:51
【问题描述】:
我有以下代码:
<html>
<style type="text/css">
DIV { display:inline; border: solid red 1px; }
.editable { background:yellow; }
</style>
<div class="editable" contentEditable="true"> This is test text. This is test text.This is test text.This is test text.This is test text.Thihis is test text.This is test text.</div>
<div class="editable" contentEditable="true"> short </div>
<div class="editable" contentEditable="true"> This is test text.This is test text.This is test text.his is test text.Thihis is test text.Thihis is test text.Thihis is test text.Thi </div>
我需要 IE7(不需要 IE6,FF3.x 可以正常工作)来正确包装文本,如果我从 div 中删除 contentEditable="true" 就可以了。只需尝试使用和不使用 contentEditable 的代码,您就会明白我的意思。使浏览器窗口足够小,以便您看到文本的换行方式。
谢谢。
【问题讨论】:
-
IE8 的行为与 IE7 相同,如果您好奇的话。
-
我在 ie8 中发现了完全相同的问题。我试图解决使用 -ms-word-break : break-all 的问题,以明确表示我想要默认换行,但没有机会。所有其他浏览器都正确。
标签: html internet-explorer internet-explorer-7 contenteditable