CSS Font properties
The CSS font properties define the font family, boldness, size, and the style of a text.
Serif and Sans-Serif
Sans-Serif | Serif |
---|---|
F
|
F
|
Serif fonts have small lines at the ends on some characters
"Sans" means without - these fonts do not have the lines at the ends of characters
Font-family
- The font family of a text is set with the font-family property.
- The font-family property should hold several font names as a "fallback" system. If the browser does not support the first font, it tries the next font, and so on.
This is a paragraph, shown in the Times New Roman font.
This is a paragraph, shown in the Arial font.
Font Style
This property has three values:
- normal - The text is shown normally
- italic - The text is shown in italics
- oblique - The text is "leaning" (oblique is very similar to italic, but less supported)
This is a paragraph in normal style.
This is a paragraph in italic style.
This is a paragraph in oblique style.
Font Size
-
Absolute
-
Relative