HTML文档中的Rich Text Editors如何实现其丰富的文本格式? [英] How do Rich Text Editors in HTML documents achieve their rich text formatting?

查看:389
本文介绍了HTML文档中的Rich Text Editors如何实现其丰富的文本格式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以请您解释文本区域中的文本在富文本编辑器中的样式吗?我试图在表单中设置样式文本,但不会改变。



JS是否识别用户输入的字符?如何完成?






编辑:



的研究(Google规则!),我发现了一些很好的信息。对于可能感兴趣的其他人,这些链接对我非常有帮助:




解决方案

我认为答案是你正在看的是通常不是实际的< textarea> 。这是一个< div> < span> 使其看起来像一个文本区域。



富文本编辑器将具有修改内容的控件具有常规html标记(< strong> < em> 等)的span /一个完整的富文本编辑器


Could you please explain how the text in the textarea gets styled in rich-text editors? I've tried to style text in the form but it doesn't change.

Is it JS that recognizes characters typed by the user? How's that done?


Edit:

After a bit of research (Google rules!), I've found some excellent information. For others who might be interested, these links were very helpful to me:

解决方案

I think the answer is that what you're looking at is typically NOT an actual <textarea>. It's a <div> or <span> made to look like a text area. A regular HTML textarea doesn't have individual formatting of the text.

"Rich-Text editors" will have controls that modify the contents of the span/div with regular html markup (<strong>, <em>, etc.) to emulate a full-blown rich text editor

这篇关于HTML文档中的Rich Text Editors如何实现其丰富的文本格式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆