In the last article, we learned about various properties to customise text in web pages using CSS. Customisation of text is incomplete without applying various fonts to text. So let's study about fonts in CSS.
To add more than one font family, use commas to separate fonts.
Font Family
The font-family property is used to set the font family to the text. Although only one argument is required as value to this property, it is always recommended to add several font names to property as the browser will check next font names if it does not support the first font and so on.To add more than one font family, use commas to separate fonts.
Font Style
The font-style property is used to specify the italic text. The following three values are supported:- normal - Normal text
- italic - Italic text
- oblique - Similar to italic, but not used and supported frequently
Font Size
The font-size property is used to set the size of the text. Size is of the following two types:
- Absolute size
- Sets text to the specified size
- User cannot change text size in some browsers
- Not used unless output is of fixed size
- Relative size
- Sets the size relative to surrounding elements
- Allows user to change text size in browsers
The default size of normal text, such that in paragraphs is 16px in absolute scale or 1em on the relative scale.
That's all for today. We will continue this font size in next article with examples.
Till then #keepCoding.
Comments
Post a Comment