Android update for CSS media queries

Check out the new site at https://rkblog.dev.

If you are using CSS media queries to use custom CSS for mobile devices then you might want to know that newer Android versions (starting from 2.3 or 2.2) won't use max-device-width. Instead they use -webkit-device-pixel-ratio, like so:

<link rel="stylesheet" media="screen and (-webkit-device-pixel-ratio:0.75)" href="style_mobile.css" />

RkBlog

Linux and programming, 18 October 2011


Check out the new site at https://rkblog.dev.
Comment article
Comment article RkBlog main page Search RSS Contact