Change font of a textarea
Moderator: General Moderators
Change font of a textarea
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
this should work:
Only put whatever fonts you want in it 
Code: Select all
<textarea name="text2" cols="100" rows="50" [color=#FF0000]style="font-family:Century Gothic;"[/color]>default</textarea>Re: Change font of a textarea
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 
Re: Change font of a textarea
lol dont worry, if you dont seem stupid once in a while, your not human 
- Tit for Tat
- Forum Newbie
- Posts: 3
- Joined: Wed Feb 10, 2010 8:14 am
- Location: Sweden
Re: Change font of a textarea
Bad way of doing it. According to the W3C all styling should be done in the CSS file when possible.aravona wrote:this should work:
Only put whatever fonts you want in itCode: Select all
<textarea name="text2" cols="100" rows="50" [color=#FF0000]style="font-family:Century Gothic;"[/color]>default</textarea>
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
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.
- Tit for Tat
- Forum Newbie
- Posts: 3
- Joined: Wed Feb 10, 2010 8:14 am
- Location: Sweden
Re: Change font of a textarea
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.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.
Read up on the issue here: http://www.thesitewizard.com/webdesign/ ... -use.shtml
- daedalus__
- DevNet Resident
- Posts: 1925
- Joined: Thu Feb 09, 2006 4:52 pm
Re: Change font of a textarea
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
nowadays you can embed fonts fairly reliably though