Use css font-family to modify the text font in the textarea

 CSS font-family can be used to set and modify text fonts in web pages, and can also be used to beautify textarea text field fonts in HTML forms , allowing netizens to enter text while rendering the style similar to the overall web page Aesthetics, it’s quite simple to modify the textarea text font through font-family . It only needs one line of grammar to complete, and it is also very convenient to modify it to other fonts later. Here are a few different font effects for your reference. Almost all major browsers support it.


Use css font-family to modify the text font example in the textarea
<textarea style="font-family:serif;">This is serif font</textarea>
<textarea style="font-family:sans-serif;">This is sans-serif font</textarea>
<textarea style="font-family:cursive;">This is cursive font</textarea>
<textarea style="font-family:fantasy;">This is fantasy font</textarea>
<textarea style="font-family :monospace;">This is the monospace font</textarea>
Rendering effect
    
There are five commonly used font-family safe fonts, namely serif, sans-serif, cursive, fantasy and monospace. Just like the writing in the example, you can write font-family directly in the opening tag of the textarea, inside the textarea All text of will be presented in the font we set.

Not familiar with the design rules of HTML textarea? Read this first: HTML textarea text field .

The commonly used safe fonts may not be enough to meet the style that all designers want to present. Of course, font-family is not the only one. If you want to modify the font of the textarea to other common Windows fonts, such as the new detailed font , Biaokai or Microsoft Zhenghei can also do it, please refer to this article: CSS font-family font .

Post a Comment

0 Comments