”;
CSS Fonts allows to customize font style of webpages using various font related properties. In this tutorial we will understand the font styling in CSS.
What is CSS Font?
In CSS font property is used to style and adjust type of text used in webpage.
You can define fonts and customize their appearance by setting properties like font-family, font-size, font-weight and font-style. You can also use shorthand property font to manipulate all the font style.
Table of Contents
Types of Font Families
- Monospace Fonts: The font in which every letter have equal width.
- Serif Fonts: Have small stroke at the edge of each letter.
- San-Serif Fonts: Clean fonts with out any strokes.
- Fantasy Fonts: Decorative fancy fonts.
- Cursive Fonts: The font that resembles human handwriting.
Popular CSS Fonts
Generic Font Family | Examples of Font Names | |
---|---|---|
Serif | Times New Roman Georgia Garamond |
|
Sans-serif | Arial Verdana Helvetica |
|
Monospace | Courier New Lucida Console Monaco |
|
Cursive | Brush Script MT Lucida Handwriting |
|
Fantasy | Copperplate Papyrus |
Property | Description | Example |
---|---|---|
font-family | Specifies the font for an element. |
|
font-size | Specifies the size of the font. |
|
font-weight | Specifies the boldness of the font. |
|
font-style | Specifies the style of the font (normal, italic, oblique). |
|
font-variant | Specifies whether or not a text should be displayed in a small-caps font. |
|
line-height | Specifies the line height. |
|
”;