开发者

Creating an unbreakable elements in contenteditable/WYSIWYG

I'd like to be able to create some element that cannot be broken in two (divided). Simply speaking I'd like to get an effect which you get when using this code in Firefox:

  <div contenteditable>
    <img src="MRC" title="Some info about this element"  alt="text t be displayed" />
  &l开发者_如何学Got;/div>

In fact I did wanted to use img but sadly this doesn't work cross-browser (IE displays a missing picture indicator, Chrome does not display alt at all, Opera always displays a border).

Also I'd like to have an option to wrap the text that I currently use for "alt" which doesn't seem to work in any browsers.

The most valuable thing about using img here is that the alt text can be formatted with outer tags (e.g. made to be bold).


Nest a non-editable element:

<div contentEditable="true">
    <span contentEditable="false">Text to be displayed</span>
</div>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜