ZoomCities IT Community Webmaster Forum

Full Version: How do I make different colors in the same text area?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is it possible to have different colors in the same textarea?
like maybe for example if these words were in the textarea, they would have different colors: "red" "green" "blue"
would it be possible if in one text area, red would be the color red, green would be green, blue would be blue?

how would i do it if its possible? if not, is it possible to have a substitude?
I would create extra text styles in my CSS (named h1,h2,h3 etc) then have each one the relevant colours, that way when you are righitnt the text you can just us <h1>red</h1> and so on.

Sorry if it isn't explained well, I am at college haha When I get home I add to MSN and i'll sort you out Smile
Fadel Wrote:I would create extra text styles in my CSS (named h1,h2,h3 etc) then have each one the relevant colours, that way when you are righitnt the text you can just us <h1>red</h1> and so on.

Sorry if it isn't explained well, I am at college haha When I get home I add to MSN and i'll sort you out Smile

"not well explained"... can you like be specific?
i know it has to do with playing around with the styles, but i mean like how? im sure it has to do with something with scripting, but i dont know what


oh, and i'd prefer if you tell me the solution on the forum, its more clear
I don't like to tell people how to do something, I prefer to let them find out.

//In the CSS//

#h1 {
color: #FFFFFF;
}



Obviously change the colour.

//Content//

Colours are <h1>Red</h1>


and so on, changing the colours and the h1 to h2 etc
oh umm, i think you got my meaning mixed up
i meant in a <textarea> tag

sorry for misunderstanding
silentwf Wrote:oh umm, i think you got my meaning mixed up
i meant in a <textarea> tag

sorry for misunderstanding
yea. you can do it in a text area tag, but maybe with classes:

.emerald { background:#5B9C64; }

<textarea>Blah Blah <div class="emerald">Emerald Text</div> Blah Blah</textarea>
hey silent warren,
so you have it done now?
otherwise getting onto http://www.w3schools.com may help?
Yeah i would prolly use the divs too, bc headers will give you a lot of space on top and bottom right?
DanLatimer Wrote:Yeah i would prolly use the divs too, bc headers will give you a lot of space on top and bottom right?
you can get rid of that my setting the margin and padding to 0, but why waste your time doing that when you can have your own custom class or div.
Hmm, i found the site i was refering to that used this script
http://tw.knowledge.yahoo.com//htmlarea/htmlarea.js
and it was hella long = ="
so i think ill "abandon" this plan

(lock thread?)
I'll leave the discussion open, only really close if it goes off topic. Smile
Silent: You mean different color in textarea as WYSIWYG message posting? If that what you mean, well I've done once. It is not a textarea but using "iframe". You can check the coding and example in -> http://www.devguru.com/features/tutorial...siwyg1.asp
anizaha Wrote:Silent: You mean different color in textarea as WYSIWYG message posting? If that what you mean, well I've done once. It is not a textarea but using "iframe". You can check the coding and example in -> http://www.devguru.com/features/tutorial...siwyg1.asp

it is!! thanks anizaha!! been looking for something like this for a long time
welcome
Reference URL's