1024programmer HTML5 What is the font tag in html? how to use? (detailed code)

What is the font tag in html? how to use? (detailed code)

What is the font tag in html? how to use? This article will introduce to you what the tag is, and let you understand the usage of the font tag. There is a certain reference value, friends in need can refer to it, I hope it will be helpful to you.

First of all, let’s understand what the tag is? What’s the use?

font (font), as the name implies, the tag is a tag that sets the text style, and can set the font style, font size, and font color of the text.

Let’s introduce the usage of tag in HTML through a simple code example!


 	
 		
 		
 	
 	
 

This is a test text

Use italics to display text

Change the color of the font text

Change the font size

Effect picture:

 /*Set italics*/
  /*Set bold*/

2, color: Specifies the color of the text.

 /*Legal color value: rgb(x,x,x), #xxxxxx (16 color system)  , colorname (English name of the color)*/

Example:

 /*Set the text  color is white */
  /*Set the text color to white*/
  /*Set the color of the text to white*/

3. size: Specifies the size of the text.

 /*number: A number from 1 to 7, the default value of the browser is 3.  */

Example:

 /*Set the size of the text to 5,  Equivalent to a size of 24px*/

Next, let’s look at the browser’s support for the tag:

It can be seen that all major browsers support the tag.

Summary: The above is what is the tag introduced in this article? The whole content of the label usage, you can try it yourself to deepen your understanding, and hope it will be helpful to your study.

【Recommendation for more related tutorials】:

HTML Video Tutorial

Html5 Video Tutorial

bootstrap Video Tutorial

The above is What is the font tag in html? how to use? For more details (code explanation), please pay attention to other related articles on 1024programmer.com!

This article is from the internet and does not represent1024programmerPosition, please indicate the source when reprinting:https://www.1024programmer.com/what-is-the-font-tag-in-html-how-to-use-detailed-code/

author: admin

Previous article
Next article

Leave a Reply

Your email address will not be published. Required fields are marked *

The latest and most comprehensive programming knowledge, all in 1024programmer.com

© 2023 1024programmer - Encyclopedia of Programming Field
Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us