Page 1 of 1

Change font of a textarea

Posted: Wed Jan 27, 2010 4:02 pm
by lshaw
I was wondering how you change the font of a textarea (just like the one i used to post this message :) )

Re: Change font of a textarea

Posted: Thu Jan 28, 2010 3:31 am
by aravona
this should work:

Code: Select all

<textarea name="text2" cols="100" rows="50" [color=#FF0000]style="font-family:Century Gothic;"[/color]>default</textarea>
Only put whatever fonts you want in it :)

Re: Change font of a textarea

Posted: Fri Jan 29, 2010 10:55 am
by lshaw
Thanks for the answer. I just assumed it wouldn't we that simple for some reason. :? Im sure I had tested it. I must seem really stupid :lol:

Re: Change font of a textarea

Posted: Mon Feb 01, 2010 3:27 am
by aravona
lol dont worry, if you dont seem stupid once in a while, your not human :D

Re: Change font of a textarea

Posted: Wed Feb 10, 2010 8:32 am
by Tit for Tat
aravona wrote:this should work:

Code: Select all

<textarea name="text2" cols="100" rows="50" [color=#FF0000]style="font-family:Century Gothic;"[/color]>default</textarea>
Only put whatever fonts you want in it :)
Bad way of doing it. According to the W3C all styling should be done in the CSS file when possible.

Code: Select all

[color=#FF00BF]textarea[/color] {
font-family: [color=#0000FF]Century Gothic[/color];
font-size: [color=#0000FF]1em[/color];
}

Re: Change font of a textarea

Posted: Wed Feb 10, 2010 9:14 am
by aravona
Fair enough I'd probs do it that way but I just cut and paste the example from google. It still works, but its just not as tidy.

Re: Change font of a textarea

Posted: Wed Feb 10, 2010 10:01 am
by Tit for Tat
aravona wrote:Fair enough I'd probs do it that way but I just cut and paste the example from google. It still works, but its just not as tidy.
No problem. Just one more notest to the topic starter. You will need to set alternative values as well for the "font-type", this because the fonts are not loaded from the server but from the users machine. Just using one font type could result in issues if the user does not have that font installed.

Read up on the issue here: http://www.thesitewizard.com/webdesign/ ... -use.shtml

Re: Change font of a textarea

Posted: Wed Feb 10, 2010 2:31 pm
by daedalus__
most browsers will revert to the default font set in its configuration if the specified family can't be found.

nowadays you can embed fonts fairly reliably though :)