Search code examples
cssmedia-queriestablet

Fooling CSS Media Queries


I use a tablet for all my schoolwork because I don't have a good computer, but websites often come up in mobile device format. Is there a way to set my browser to tell websites that it is a computer, and not a tablet? If it were possible, would this cause any other problems, like disabling the touchscreen, or anything like that?


Solution

  • There's a couple different ways to tell if you're using a tablet. Typically it's either by:

    • screen size (noting the typical width/height ratios of devices) and then styling by media query
    • the window.navigator object in the browser is aware of a handful of useful info, such as OS and browser details

    Each site will determine this differently so I wouldn't be confident there's a catch-all solution to this one...that being said sometimes landscape will get desktop styling if the devs used the sizing method ¯_(ツ)_/¯