Skip to content

Instantly share code, notes, and snippets.

@davidsword
Created September 14, 2016 22:41
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 davidsword/d9babb72324354f79f884ca082770e21 to your computer and use it in GitHub Desktop.
Save davidsword/d9babb72324354f79f884ca082770e21 to your computer and use it in GitHub Desktop.
/* CSS */
/* Basic responsive */
@media screen and (max-width: 960px) {
/* ..custom CSS for viewports less than 960 here */
header { /*...*/ }
article { /*...*/ }
footer { /*...*/ }
/* etc.. */
}
/* Smartphones */
@media only screen
and (max-device-width : 480px) {
header { /*...*/ }
article { /*...*/ }
footer { /*...*/ }
/* etc.. */
}
/* iPads (portrait)*/
@media only screen
and (min-device-width : 768px) {
header { /*...*/ }
article { /*...*/ }
footer { /*...*/ }
/* etc.. */
}
/* Pixels */
only screen and (-webkit-min-device-pixel-ratio : 2),
only screen and (min-device-pixel-ratio : 2) {
/* HiDPI Retina screen */
/* for those who know how to use
background-size and 2x images */
/* etc.. */
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment