The CSS font properties allow you to set various styles for fonts like font family, size and boldness, variant, etc. of a text.
Following are the properties:
font-family
font-size
font-style
font-variant
font-weight
Font-Family:
The font-family property can hold various font names as a fallback system. If the browser does not support the first font, it tries the second font, and so on.
Write the font name that you want and end with a generic family because if fonts are not available then the browser picks a similar font in the generic family.
CSS font-family are two types:
Generic family: It contains Serif, Sans-serif, and Monospace.
Font family: It includes the font family name like Arial, New Times Roman, etc.
The font-size is set by using em (1em, 2em, etc) values also. If you set a font-size of 10px on the body element, then 1em = 10px. If you have not set the font-size then the browser default size probably 16px. So, by default 1em=16px.
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.Ok