1. font-family: Set Font type
<family-name>: Font name. Ranked in order of precedence. separated by commas. If the font name contains spaces or Chinese, you should enclose it in quotation marks.
- The user agent iterates through the defined font sequence until it matches a font.
-
body { font-family: helvetica, verdana, sans-serif; }
As in the font definition, if you do not have a Helvetica font on your machine, but you have Verdana, you will see your text in Verdana.
2. Color: Font Colors
Color can be specified using color name, HEX, RGB, RGBA, HSL, HSLA, Transparent.
Because different browsers render different color names, it is recommended that you use #hex to represent colors.
3. Font-style: Set font style
-
Normal
-
Specifies that the text font style is normal
-
Italic
-
Specifies that the text font style is italic. For special fonts that do not have italic design, apply oblique if you want to use italic appearance
-
Oblique:
-
Specifies the font that the text font style is italic. Artificially tilt the text instead of selecting italic characters in the font
4, Font-size: Set the font size, generally with px
You can set an absolute size, or you can set a relative size.
5. Font-weight: Set the font weight
Normal: Regular font
Bold: Bold
Bolder: Defines values that are heavier than the inherited value
Lighter: Defines a value that is lighter than the inherited values
General direct use of numbers, 400, 800 and so on.
CSS Basics-Fonts