Fonts
The font property in CSS is used to customise the appearance of text. You can modify the text size, colour, style, and more using the CSS font property.
Fonts play an important role in website designing. The correct size and font help the user to read the content properly and creates a good impact on the user.
The generic font families are as follows:
- Serif fonts There is a small stroke at the edges of each letter
- Sans Serif fonts No strokes attached to the letters
- Monospace fonts All lets of fixed size
- Cursive fonts Having a human-like font
- Fantasy fonts Decorative font
Here are some key font characteristics:
- Font colour in CSS: This attribute is used to alter the text's colour. (separate attribute)
- Font family in CSS: This feature is used to alter the font's appearance.
- Font size in CSS: The font size can be increased or decreased using the CSS Font size attribute.
- Font style in CSS: This attribute is used to make the typeface bold, italic, or oblique in CSS.
- Font variant in CSS: This attribute generates a small-caps effect in CSS fonts.
- Font weight in CSS: The font's boldness and brightness can be increased or decreased using the CSS Font weight attribute.
Example No.1:
Knowledge2life
Knowledge2life 1.
Knowledge2life 2.
Knowledge2life 3.
OUTPUT:
Knowledge2life
Knowledge2life 1.
Knowledge2life 2.
Knowledge2life 3.
Example No.2:
Knowledge2life
Knowledge2life 2
Knowledge2life 3.
OUTPUT:
Knowledge2life
Knowledge2life 2
Knowledge2life 3.