Change the text area font

I think this is a simple and stupid question. I have included the text area in my html script.

Can I change the default font for a text area?

By default, it does not look very good. I hope there is a way to change it.

+7
source share
4 answers

Yes, using the CSS font-family property, like any other element.

W3C has a CSS tutorial , like Mozilla

+13
source

You can simply open your css file and write the code as follows

 textarea { font-family:"Times New Roman", Times, serif; font-size: 12px; } 

Following the procedure described above, you can change the default property for any HTML tag that you want.

+8
source

And a bright version of the shortcut (not recommended):

  <textarea rows="5" cols="50" style="font-family:Times New Roman;color:#003399;white-space:pre-wrap">Put your text here</textarea> 
+6
source

You can also use a short version of the font.

 textarea { font: 12px "Times New Roman", Times, serif; } 

Values:

 font: font-style font-variant font-weight font-size/line-height font-family; 
+4
source

All Articles