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
- Points (pt) and dpThe size units phones use instead of raw pixels, so a 44 pt or 48 dp button is about the same physical size on every screen.
- Touch targetThe area of the screen that responds to a tap, which should be large enough for a finger.
- ViewportThe visible area of a web page in the browser window or on the device screen.
- WCAGThe Web Content Accessibility Guidelines, the main international standard for accessibility.