drake035
drake035

Reputation: 2897

Getting viewport size on a mobile

On my Optimus One LG mobile, I get "700" both for the window.innerWidth and document.documentElement.clientWidth variables, whereas I know that the resolution of this mobile is 320px in width that is quite low resolution.

The page where I display these variable values has in its header.

Why do I not get 320 instead of 700 ?

Upvotes: 1

Views: 315

Answers (1)

mash
mash

Reputation: 15229

Adding <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> might help, if you have not already added a viewport meta.

Upvotes: 1

Related Questions