Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Viewport meta tag not working phonegap

Viewport meta tag not working on phonegap build. There is white space between content and screen.

The meta tag that i am using is :

<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />

It appears like this and is scrollable :

However it should be like this without any scroll: enter image description here

like image 277
Hamza Avatar asked Jan 07 '14 11:01

Hamza


People also ask

Why is viewport meta tag not working?

What does “The initial scale in the viewport meta tag is not working” mean? This means that the URL in question does not contain the initial scale in the HTML document. Or, this element is on the page, but you set it to a value other than 1.0.

What is viewport in meta tag?

The viewport is the user's visible area of a web page. It varies with the device - it will be smaller on a mobile phone than on a computer screen.

Where is viewport meta tag?

Generally, meta elements (including viewport) should be placed in the document's <head> . CSS rules should either be added to a CSS stylesheet and referenced with a <link> element or, if you're not using stylesheets for some reason, in a <style> element (also in the document's <head> ).


1 Answers

Try this -

<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
like image 80
Suhas Gosavi Avatar answered Oct 25 '22 03:10

Suhas Gosavi