Skip to content

Instantly share code, notes, and snippets.

@justo
Last active December 19, 2015 21:59
Show Gist options
  • Save justo/6024581 to your computer and use it in GitHub Desktop.
Save justo/6024581 to your computer and use it in GitHub Desktop.
Simple CSS3 Media Queries
/* Justin's simple CSS3 media queries (not mobile-first) */
/* Desktops */
@media only screen and (min-width : 1024px) {
}
/* Tablets */
@media only screen and (min-width : 641px) and (max-width : 1024px) {
}
/* Smartphones (All) */
@media only screen and (max-width : 640px) {
}
/* Smartphones (Small) */
@media only screen and (max-width : 320px) {
}
/* HiDPI Devices */
@media only screen and (-webkit-min-device-pixel-ratio : 1.5), only screen and (min-device-pixel-ratio : 1.5) {
}
/* More comprehensive hidpi detection */
@media only screen and (-webkit-min-device-pixel-ratio: 2),
only screen and (min--moz-device-pixel-ratio: 2),
only screen and (-moz-min-device-pixel-ratio: 2),
only screen and (-o-min-device-pixel-ratio: 2/1),
only screen and (min-device-pixel-ratio: 2),
only screen and (min-resolution: 192dpi),
only screen and (min-resolution: 2dppx) {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment