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
Loading Editor...
Live Preview

๐Ÿ“ Font Size

Controls the size of the font using keywords, units, or relative values.
Code Example
PREVIEW READY
Loading Editor...
Live Preview

๐Ÿงฑ Font Weight

Adjusts the thickness or boldness of text.
Code Example
PREVIEW READY
Loading Editor...
Live Preview

๐Ÿ–‹๏ธ Font Style

Defines whether the font is normal, italic, or oblique.
Code Example
PREVIEW READY
Loading Editor...
Live Preview

๐Ÿงฌ Font Variant

Used to display text in small-caps (uppercase letters with lowercase sizing).
Code Example
PREVIEW READY
Loading Editor...
Live Preview

๐Ÿ“ Line Height

Controls the vertical spacing between lines of text.
Code Example
PREVIEW READY
Loading Editor...
Live Preview

๐Ÿงพ Font Shorthand

Combines multiple font-related properties in a single declaration.
Code Example
PREVIEW READY
Loading Editor...
Live Preview

๐Ÿง  Test Your Knowledge

5 Questions

Progress: 0 / 5
Keep Going!CSS - Links