I have a css code like this for mobile devices:
@media all and (min-width: 0px) and (max-width: 991px) {...}
and I have this html:
<meta name="viewport" content="width=1024, initial-scale=1" id="viewportMt"> <script> window.onload = function () { if(screen.width < 970) { var vp = document.getElementById('viewportMt'); vp.setAttribute('content','width=640, initial-scale=1'); } } </script>
The main problem is that when I first open my website: on most devices I need to scale my browser to fit it.
Is it possible to automatically install the device? for example, if the width of the device is 340: I have to scale it a little (because the website has a large size for 340 pixels (that's s min.640px)) ... If 900: then the scale too ...
even ipad (in portrait mode, as the width is 768 pixels).
can it be done?
plunker:
https://plnkr.co/edit/5KhIlmtLkWhtROs7y188?p=preview
and demo:

Why do I have a scrollbar? I need to zoom out somehow, so that I wonβt have a scrollbar ... and my container should be 640px and no other values ββfor mobile devices ...
javascript html css mobile media-queries
brabertaser19
source share