What is the correct practice for php computer version and mobile version?

the method I am using now is either very correct for
, or using css to determine the accuracy. If it is higher than 1000, it is the traditional version
, lower than 999 is the mobile version
, and then use display:none to turn it on

.
<div class="desktop">style</div>

<div class="device">style</div>

but the css of the content can also be changed due to settings.
the point is that if you directly use the mouse to pull the window left and right, you can know how the mobile version and the computer version
is missing from all versions of the content.
some can use css to determine the mobile version and the computer version,
but some versions are too traditional, and there is too much difference between the computer version and the mobile version. I think there is a better way to solve
by using css.

You can use two sets of templates when the

page is too complex. The back end determines that the ua, will load the template of the mobile terminal if it is mobile, otherwise the template of the PC side will be loaded. As for quickly viewing the page of a certain end, you can add a get parameter to force the backend to load the template of a certain end


, which is not complicated and can be adaptive

.
Menu