I am just starting out with developing a mobile application using Html, Css, Js via PhoneGap, and my first goal is to ensure that all content fits perfectly with any given phone. Therefore, I want to ask you if my approach is correct and how to implement it.
My idea is to take Width and Heigh using JavaScript, I think there are some PhoneGap functions that return these values. Then I will use these values ββto set the html Width and Heigh (I think I should do this using the onBodyLoad () function, correct me if not), so I set the html body to the device screen size, and then I put all other elements through% instead of pixels.
I also saw this line in a random search:
<meta name="viewport" id="viewport" content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0, user-scalable=no;" />
It seems like this should work too, but I'm not sure what it does and how it works. Su ... what do you think is the best way to do this? maybe thereβs another one that I donβt know about?
Many thanks for the help!
source share