Skip to content

Instantly share code, notes, and snippets.

@pketh
Created November 27, 2012 03:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pketh/4152195 to your computer and use it in GitHub Desktop.
Save pketh/4152195 to your computer and use it in GitHub Desktop.
Simple Mobile First @media queries
/*
=============================
# Mobile First @media queries
=============================
*/
/* styles for iphone portrait go up here*/
/* Smartphones (landscape) ----------- */
@media only screen
and (min-width : 321px) {
/* styles */
}
/* iphone 5 landscape ---------------- */
@media only screen
and (min-width : 568px) {
/* styles */
}
/* iPads (portrait) ------------------ */
@media only screen
and (min-width : 768px) {
/* styles */
}
/* iPads (landscape) ---------------- */
@media only screen
and (min-width : 1024px) {
/* Styles */
}
/* Desktops and laptops ------------- */
@media only screen
and (min-width : 1224px) {
/* Styles */
}
@pketh
Copy link
Author

pketh commented Nov 27, 2012

Keep in mind: styles cascade down as screen sizes increase

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment