Interested in the question of how to make a template for mobile devices, so that the width at the entrance to the site was set automatically and there was no need to bring anything closer, on the bash.

Made such type:

@media only screen and (device-width: 480px) { body { width: 470px; } } @media only screen and (device-width: 320px) { body { width: 310px; } } @media only screen and (device-width: 360px) { body { width: 350px; } } @media only screen and (device-width: 240px) { body { width: 230px; } } 

But the results were not ... I went through the Opera Mobile - the site looks on the computer, that is, you still need to increase.

  • Maybe <meta name = "viewport" content = "width = device-width, initial-scale = 1.0"> - Furry Cat

2 answers 2

Do not use clear restrictions, use the maximum size and better without the device , I checked, it works

 @media only screen and (max-width: 480px) { body { width: 470px; } } 

    Try simple:

      body { width: 100%; }