Defining the Viewport Meta Tag

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

A critical component of using jQuery Mobile is adding the viewport settings in a <meta> tag inside the page <head> tag. The viewport defines how the browser displays the page zoom level and the dimensions used.

Specifically, you need to set the content="width=device-width, initial-scale=1" as shown next. These settings force the device’s browser to render the web page width at exactly the number of pixels available on the device:

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

Without specifying the viewport setting, the mobile page is at a much higher size ...

Get jQuery and JavaScript Phrasebook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.