How to set width in android using javascript?

I need to set the page width, which is compatible for all sizes of Android device. Why did I use the following code:

meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"

I also tried target-densityDpiwith all the properties, also in target-densityDpi, I gave a number from 70 to 400

the width does not fit the screen, either the width overflows the width of the screen (with a smaller screen), or the width is too small (on the larger display, which is in the device with a display with a diagonal of 4 to 5 inches)

+5
source share
2 answers

I have the same problem. I use:

meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"

and

meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1 user-scalable=no"

" ' ... Android .

javascript? ... - viewport

0

, :

<meta charset = "utf-8" name = "viewport" content = "width=device-width, user-scalable = no, target-densitydpi=mdpi">

css :

body {
   width: 100%;
}

mdpi . , device-dpi

0

All Articles