html - viewport doesn't work correctly -


When I browse the page with a smart phone, I have difficulty setting 100% width for the body.
Viewport settings << Pre> Meta name = "viewport" content = "width = device-width"
looks like console size

screen.width = 320
screen.availWidth = 320
window.innerWidth = 975
window.outerWidth = 320
$ (window) .width () = 320
document.documentElement.clientWidth = 320 < Br> document .width = $ 975 (document). Wide () = 975
$ ('body'). Width () = 970

And I said 'width: 975 px' for the body's CSS - Then the console shows the size below

< P> screen.width = 320
screen.availWidth = 320
window.innerWidth = 977
window.outerWidth = 320
$ (window) .width () = 320
document.documentElement .clientWidth = 320
document.width = 977
$ (document) .width () = 977
$ ('body') width () = 975

I want to determine the width of the body as the width of the document. Can anyone know how I can fix it?

Did you try to use meta tags with 'initial-scale' properties?

  & lt; Meta name = "viewport" content = "width = device-width, initial-scale = 1" & gt;  

Comments