我想尝试一下下面的用户界面:
我尝试使用一个可内容编辑的div,并用contenteditable=false元素将引号括起来。下面是一个例子
<div id="editor" contenteditable="true"
style="height:200px; border:1px solid black">
This is some editable content.
<p><div contenteditable="false">This content should not be editable
<i contenteditable="true">(but this is)</i>.
</div></p>
</div>然而,我发现Chrome (大概也就是WebKit)允许你选择contenteditable元素的只读部分中的文本,而Firefox只允许你把contenteditable当做一个大块,一次选择所有内容。有什么办法可以解决这个问题吗?有没有更好的方法来做我建议的事情?
发布于 2013-02-06 18:17:28
你可以试试这个。
<div id="editor" style="height:200px; border:1px solid black">
<p contenteditable="true">This is some editable content.<p>
<div>
<p>This content should not be editable
<i contenteditable="true">(but this is)</i>.
</p></div>
</div>希望这能有所帮助
https://stackoverflow.com/questions/2302065
复制相似问题