我有以下代码:
<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 的代码,您就会明白我的意思。使浏览器窗口足够小,以便您看到文本是如何换行的。
谢谢。