在一个文本区域中可以有几个不同的文本颜色吗? [英] Is it possible to have several different textcolors in one textarea?

查看:95
本文介绍了在一个文本区域中可以有几个不同的文本颜色吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在一个textarea的几个单词/阶段出现不同的颜色...我该怎么做?下面是一个例子,我想绿色的字出现绿色等等...

 < textarea style = width:100%; height:100%; resize:none;> 
在textarea中有可能有多种颜色吗?
我如何将某些阶段或单词设置为不同的颜色?
Green
Red
Blue
< / textarea>


解决方案

/ em> a < textarea> ,而不是可编辑的。这听起来像是您在 WYSIWYG编辑器之后,其中大多数使用< iframe>



有几个JavaScript选项, b
$ b


I'd like several words / phases in a textarea to appear in different colors... How would I go about doing this? Below is an example, I'd like the word green to appear green etc etc...

<textarea style="width: 100%; height: 100%; resize: none;">
Is it possible to have multiple colors in a textarea? 
How would i set certain phases or words to be different colors? 
"Green"
"Red"
"Blue"
</textarea>

解决方案

You can't do this inside a <textarea>, not one that's editable. It sounds like you're after a WYSIWYG editor, most of which use a <iframe> to do this.

There are several JavaScript options for this, to name a few:

这篇关于在一个文本区域中可以有几个不同的文本颜色吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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