Change font of a textarea
Posted: Wed Jan 27, 2010 4:02 pm
I was wondering how you change the font of a textarea (just like the one i used to post this message
)
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
<textarea name="text2" cols="100" rows="50" [color=#FF0000]style="font-family:Century Gothic;"[/color]>default</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];
}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.