I've seen around the web that the best way to make a responsive design is to use CSS @media
queries. This does not seem like a practical solution as many phones identify as screen
and have as many pixels as desktop monitors (i.e. the iPhone 6 Plus is 1080x1920 and some Android phones have even larger sizes). So if I said min-width: 800px;
for my desktop design, many smartphones would use those rules.
One workaround is to use navigator.userAgent
in JavaScript to detect mobile devices, but I've also heard that this is not widely compatible.
Is there a 'best' way to determine if a user is on a mobile device (preferably with JavaScript or CSS)?