Skip to content

Instantly share code, notes, and snippets.

@robspangler
Last active July 13, 2016 20:50
Show Gist options
  • Save robspangler/ed51b7e6a9e8bc90ea43b8fa2336c41c to your computer and use it in GitHub Desktop.
Save robspangler/ed51b7e6a9e8bc90ea43b8fa2336c41c to your computer and use it in GitHub Desktop.
/* Desktop First */
.only-mobile { display: none !important; }
.only-tablet { display: none !important; }
@media only screen and (max-width: 767px) {
.only-tablet { display: block !important; }
.only-desktop { display: none !important; }
}
@media only screen and (max-width: 480px) {
.only-mobile { display: block !important; }
}
/* Mobile First */
.mobile-only { display: block; }
.tablet-only { display: none; }
.handheld-only { display: block; }
.desktop-only { display: none; }
@media only screen and (min-width: 768px) {
.mobile-only { display: none; }
.tablet-only { display: block; }
.handheld-only { display: block; }
.desktop-only { display: none; }
}
@media only screen and (min-width: 960px) {
.mobile-only { display: none; }
.tablet-only { display: none; }
.handheld-only { display: none; }
.desktop-only { display: block; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment