The font properties allows set font style, size, variant.
The font-family sets the font for element. There are two types of values for this property.
1. Family name: like “Helvetica”
2. Generic name: like “Arial”
Following is the example of font-family. The following code will apply fonts to <p> element.
This property will set the size of the text in the element. There are several values for this property, these are as follows:
o % (percent)
Various properties can be set from extra small to extra large. Also length can be set for font-size property.
For example using length property:
The font style property sets the font style. Following are the values for this property.
You can set variant of the text within the element. Following are the values for font-variant:
o normal: It displays the normal font.
o small-caps: In this case the all the characters are in uppercase but they are displayed smaller than other fonts.
You can set the weight of the font using this property. It has a fixed set of values those are as follows:
We can set all the properties mentioned above by grouping them under the “font” property.
We can set font family, size, variant, weight under one name.
For example :