Tree of DesignAll terms A–Z

Media Query

A CSS rule applying styles based on device features.

See it on the 3D tree

Going deeper

Written with the @media rule, it wraps styles that apply only when a condition is true. Conditions include viewport width, orientation, pointer precision, hover ability, print output and user preferences such as reduced motion or colour scheme. Container queries are related but respond to an element's container instead.

Why it matters

You can specify how a design should respond to circumstances beyond width, including how people interact and what they prefer.

In practice

You ask for large transitions to be removed when someone has set their system to reduce motion.

Common mistake

Assuming a narrow screen means touch and a wide one means mouse, instead of querying pointer features or designing for both.

Connected terms