Skip to content

Instantly share code, notes, and snippets.

@appkr
Last active August 29, 2015 14:14
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 appkr/65b9cf9e973e7f71e8a7 to your computer and use it in GitHub Desktop.
Save appkr/65b9cf9e973e7f71e8a7 to your computer and use it in GitHub Desktop.
Css Media Queries
/* Portrait */
@media screen and (orientation:portrait) {
/* Portrait styles */
}
/* Landscape */
@media screen and (orientation:landscape) {
/* Landscape styles */
}
/* width <= 320px */
@media screen and (max-width: 320px) {
body {
...
}
}
/* width >= 1024px */
@media screen and (min-width: 1024px) {
body {
...
}
}
/* retina */
@media
only screen and (-webkit-min-device-pixel-ratio: 1.5),
only screen and (min-device-pixel-ratio: 1.5) {
.logo {
background-image: url(logo@2x.png);
...
}
}
/* hoisting */
@media screen and (max-width: 320px) {...} /* under 320px */
@media screen and (max-width: 480px) {...} /* from 321px to 480px */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment