px vs rem media queries

A brief demo of why we should use rem units for our media queries. Try changing the default font size in your browser settings and then refereshing this page. The font-size set in the browser is currently 16px.

Pixel-based media queries

The example below has the columns switch to two columns at 600px.

Pudding powder fruitcake powder jelly bear claw. Gingerbread lemon drops tiramisu tootsie roll dragée gummies macaroon fruitcake chocolate bar. Dessert caramels tiramisu dessert candy ice cream powder.

Carrot cake oat cake chocolate croissant donut icing. Jelly beans chocolate cake fruitcake gummi bears pie icing jelly beans liquorice biscuit. Muffin chocolate bar tart gummies cheesecake powder. Chupa chups dragée bear claw macaroon pie gummies macaroon.

Rem-based media queries

The example below has the columns switch to two columns at 37.5rem.

Pudding powder fruitcake powder jelly bear claw. Gingerbread lemon drops tiramisu tootsie roll dragée gummies macaroon fruitcake chocolate bar. Dessert caramels tiramisu dessert candy ice cream powder.

Carrot cake oat cake chocolate croissant donut icing. Jelly beans chocolate cake fruitcake gummi bears pie icing jelly beans liquorice biscuit. Muffin chocolate bar tart gummies cheesecake powder. Chupa chups dragée bear claw macaroon pie gummies macaroon.