Skip to content

Instantly share code, notes, and snippets.

@kruzyk
Last active March 1, 2019 10:35
Show Gist options
  • Save kruzyk/6959c824d162b5c59086e8a280aabc5f to your computer and use it in GitHub Desktop.
Save kruzyk/6959c824d162b5c59086e8a280aabc5f to your computer and use it in GitHub Desktop.
Detect device with CSS
/* smartphones, touchscreens */
@media (hover: none) and (pointer: coarse) {
/* ... */
}
/* stylus-based screens */
@media (hover: none) and (pointer: fine) {
/* ... */
}
/* Nintendo Wii controller, Microsoft Kinect */
@media (hover: hover) and (pointer: coarse) {
/* ... */
}
/* mouse, touch pad */
@media (hover: hover) and (pointer: fine) {
/* ... */
}
/*==================================================
= Bootstrap 3 Media Queries =
==================================================*/
/*========== Mobile First Method ==========*/
/* Custom, iPhone Retina */
@media only screen and (min-width : 320px) {
}
/* Extra Small Devices, Phones */
@media only screen and (min-width : 480px) {
}
/* Small Devices, Tablets */
@media only screen and (min-width : 768px) {
}
/* Medium Devices, Desktops */
@media only screen and (min-width : 992px) {
}
/* Large Devices, Wide Screens */
@media only screen and (min-width : 1200px) {
}
/*========== Non-Mobile First Method ==========*/
/* Large Devices, Wide Screens */
@media only screen and (max-width : 1200px) {
}
/* Medium Devices, Desktops */
@media only screen and (max-width : 992px) {
}
/* Small Devices, Tablets */
@media only screen and (max-width : 768px) {
}
/* Extra Small Devices, Phones */
@media only screen and (max-width : 480px) {
}
/* Custom, iPhone Retina */
@media only screen and (max-width : 320px) {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment