4

So, I need a way to so that a CSS class is only used by desktops (Normal Screen). Eg:

.class {
  position: fixed;
}

Is only used on desktops.

Bryan Ash
  • 4,385
  • 3
  • 41
  • 57
SYS
  • 43
  • 1
  • 3
  • Check this entry http://stackoverflow.com/questions/6666907/how-to-detect-a-mobile-device-with-javascript there you could find the way in the answers – Oldskultxo Jan 24 '16 at 00:37

1 Answers1

8

Although it's not desktop specific, you can limit it to the screen based on the screen size with a media rule around it, like so:

@media screen and (min-width: 640px) {
    .class {
        position: fixed;
    }
}

This would limit your rule to only be applied if the monitor was at least 640 pixels wide, larger than a smartphone (today, anyway).

argoc
  • 333
  • 1
  • 11