1

To make a website responsive I know that we need to use css(media queries)or framework..to test if a website is responsive we need just to resize browser to see the effect.
But I have a question for example this websites paypal.com or stackoverflow.com it's responsive on mobile,but when I try to login to it from my desktop and resizing browser(not responsive)
So how these websites detects devices of visitors? Thank you

John_P
  • 103
  • 6

2 Answers2

1

Actually this can be detected at webserver level what is the user agent from where the request is coming. Based on that webserver show the website to client device. Refer this question Detecting Device Type in a web application

Community
  • 1
  • 1
amitguptageek
  • 537
  • 3
  • 13
  • Also device based media queries https://css-tricks.com/snippets/css/media-queries-for-standard-devices/ – Aaron Jan 11 '16 at 15:25
1

When testing, resizing the browser does not always give the desired effect. In chrome you can toggle device mode in the console (ctrl+shift+m) to emulate a mobile device.

In code if you want to target a particular device you can use the window.navigator.userAgent in Javascript.

Steve
  • 546
  • 5
  • 18