Skip to content
Bugwise
Menu

CSS pixel

Also called: CSS px, px

The size unit of the web: one CSS px can be several real screen pixels on a sharp display.

Definition

Web pages are measured in CSS pixels (px), not in the physical pixels of the screen. On a phone or a high-density laptop display, one CSS pixel is drawn with two or three physical pixels, and browser zoom changes the ratio again. Sizes in guidelines such as WCAG (for example 24x24 or 44x44) are always CSS pixels. DevTools shows an element's size in CSS pixels when you inspect it.

In practice

A 24x24 CSS px close button is drawn with 72x72 physical pixels on a 3x phone screen, but it is still small for a finger.

Learn it in context

Lessons that use this term.

Related terms

Esc

Type to search the whole site.