0Pricing
CSS Academy · Lesson

Absolute Units: px pt cm

Learn when to use fixed absolute units like pixels, points, and centimeters.

Absolute vs Relative Units

CSS units fall into two categories: absolute (fixed, real-world measurements) and relative (scale relative to something else). Absolute units are device-independent physical measurements.

px — Pixels

The pixel (px) is the most used absolute unit on screens. On standard displays 1px = 1 device pixel. On high-DPI (Retina) screens CSS pixels map to multiple device pixels, keeping elements the same visual size.

.button {
  padding: 10px 20px;
  border-radius: 4px;
  border: 1px solid #ccc;
}

All lessons in this course

  1. Absolute Units: px pt cm
  2. Relative Units: em and rem
  3. Viewport Units: vw vh dvh
  4. Min Max and Clamp Functions
← Back to CSS Academy