how does a website automatically know/change if you’re using it on a PC or Phone?

239 views

how does a website automatically know/change if you’re using it on a PC or Phone?

In: 2

5 Answers

Anonymous 0 Comments

The client (i.e. the browser) can choose to include a bit of extra information in the request it makes to the server, where it identifies what kind of client it is. It tells the server what browser it is, what OS it’s running, etc.

If you’re talking about changing the layout to fit the display however, that’s a bit different. Developers can write a bit of HTML and javascript code to detect the window size, and automatically rearrange/resize the UI accordingly.

You are viewing 1 out of 5 answers, click here to view all answers.