Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS media queries that capture high-resolution phones, but not lower resolution tablets

I've been using min-width: 600px as my breakpoint in my CSS media queries. My rationale was that at 600px and above I'd capture tablet devices (Kindle Fire, iPad, etc) and below 600px would capture all of phone devices.

It turns out that while the iPhone plays nice by doubling its pixels, but still reporting being 320px x 480px, there are a ton of Android phones out there with resolutions like 700px x 1280px. The trouble is, how do I capture these devices without giving them a tablet-like interface?

Normally I'd just let the content respond to the pixel resolution of the device, however, a 1280px layout on a 4.3in screen just doesn't look right, especially since my application deals with a lot of form elements, which on a phone you want to span the entire width, but on a tablet or desktop you do not.

like image 550
Ian Christian Myers Avatar asked Aug 26 '12 17:08

Ian Christian Myers


1 Answers

One good option is to tailor your media queries to your content, not arbitrary device pixel sizes, by using ems.

like image 93
David Oliver Avatar answered Oct 06 '22 23:10

David Oliver