How to make the web page support both mobile and computer versions in the mobile phone?

visiting github, with a mobile browser displays the mobile page and desktop version

at the bottom.

after clicking, the computer version of the web page will be displayed, and mobile version

will be displayed at the top.

the test found that there will be a mobile_reference in the middle

could you tell me how to implement this scheme?

Mar.10,2021

you can tell whether it is a mobile device or a pc device by navigator.userAgent .
in css , you can use @ madia to write styles for mobile devices or PC devices.


css media query


1, flexible layout, through css to achieve adaptive layout
2, can be made into two sets of programs, and then through js to determine that the request head is distributed to the project directory that does not understand

Menu