In the last article, we started learning about fonts in CSS and we will continue it in today's article.
Let's begin...
1em is equal to the normal current font size. The default text size in browsers is 16px. So, 1em = 16px.
2em = 32px...etc.
Setting font size with em helps to resize text in all browsers except old editions of Internet Explorer.
font-size: 0.45em;
Let's begin...
Set Font Size With Pixels
font-size: 30px;Set Font Size With Em
As we have seen in the previous article, that for allowing users to resize text in browsers we have to use relative sizing and em is the unit used for it.1em is equal to the normal current font size. The default text size in browsers is 16px. So, 1em = 16px.
2em = 32px...etc.
Setting font size with em helps to resize text in all browsers except old editions of Internet Explorer.
font-size: 0.45em;
Font Weight
The font-weight Property Specifies the weight of font and is used to bold the text. The font-weight has two permissible values:- normal: For simple text
- bold: For bold text
Font Variant
The font-variant property specifies whether or not a text should appear in a small Caps Font. In small caps font, all lowercase letters are converted to uppercase letters and all size of uppercase letters is reduced so that it matches font size of lowercase letters.
font-variant: small-caps;
That's all for today. In the next article, we will see how to insert cool icons in web pages using CSS.
Till then #keepCoding.