Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

different colors in a textarea

Status
Not open for further replies.

clarissa1996

Technical User
Jan 31, 2002
78
CH
I am trying (without success) to define a textarea with two words: the first word yellow and the second word red.

Here is my code (not working):

<textarea cols=20 rows=20>
<font color=yellow>Hello</font>
<font color=red>Hello</font>
</textarea>

Any help is appreciated.

Thanks for any help. Clarissa
 
I'm not sure what it is that you're trying to accomplish, but no html code can be inside the <texarea></textarea> tags, so whatever you're trying to do can't be where it is.
 
Hi Clarissa,

You can define the color (etc) of a textarea but you cannot have different colors (styles) in one single textarea.

Have a look at this example I wrote just for you:


If you just want to "show" something inside a box then you can use an IFRAME (contaiing a new page) or a DIV (with SPANs, FONTs etc) instead.

Here's a reference on IFRAMEs:


Here's a reference on DIVs:


Good Luck with your project!

Regards


Jakob
 
Like dk-dude said, it seems like you're after the visual aspect of a textarea not it's functionality. Textareas are used as big memo fields for users to write into and post to the next page. Seeing that you want to put content in your textarea suggest you do not need the functionality. Go with divs and style them accordingly.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top