Nearby lessons
12 of 19๐ค CSS Font Properties
๐ What are CSS Font Properties?
CSS Font Properties allow you to control typography, such as font family, size, weight, style, and more. These properties enhance readability, accessibility, and design consistency.
This guide includes key font-related properties and live examples to visualize their behavior in real-world scenarios.
๐ Font Family
Defines the typeface of the text by specifying one or more font names.
Code Example
PREVIEW READY
๐ Font Size
Controls the size of the font using keywords, units, or relative values.
Code Example
PREVIEW READY
๐งฑ Font Weight
Adjusts the thickness or boldness of text.
Code Example
PREVIEW READY
๐๏ธ Font Style
Defines whether the font is normal, italic, or oblique.
Code Example
PREVIEW READY
๐งฌ Font Variant
Used to display text in small-caps (uppercase letters with lowercase sizing).
Code Example
PREVIEW READY
๐ Line Height
Controls the vertical spacing between lines of text.
Code Example
PREVIEW READY
๐งพ Font Shorthand
Combines multiple font-related properties in a single declaration.
Code Example
PREVIEW READY
๐ง Test Your Knowledge
5 QuestionsProgress: 0 / 5
Keep Going!CSS - Links