Reputation: 2368
If anyone could answer this it would be a great help to newbies learning
<meta="viewport">
Upvotes: 31
Views: 24038
Reputation: 11610
name="viewport"
property of the <meta>
tag is well-supported on major browsers.<meta>
element. Put the element straight up in the <head>
.content
attribute values you provide. This tag instructs the browser to use some default for zoom values on a web page to ensure you don't end up initially displaying only a small portion of the top-right corner of the page on small devices. I'd advise reading some articles on it or, better yet, reading the W3 mobile best practices for mobile web design. Generally, you will only want to set content="width=device-width, initial-scale=1.0
to fit your web page to the device regardless of scale or orientation. I would recommend care if you choose to use the maximum-scale
and user-scalable
properties as they can cause users to not be able to zoom in on your page. (These properties can, however, be useful when developing full-screen apps or other interactive style apps where you would not want zooming to be applied)In short, adding this line to a website that should implement viewport scaling should fix most problems.
<meta name="viewport" content="width=device-width, initial-scale=1.0">
P.S. Quirksmode has a wonderful article describing the issue of viewport size relating to page sizing that's worth reading to understand why this tag might be helpful.
Upvotes: 24
Reputation: 6147
You can view all the details from Mozilla blog
https://developer.mozilla.org/en-US/docs/Web/HTML/Viewport_meta_tag
Upvotes: 3
Reputation: 1
Meta viewport tag is used to adjust the size and visibility of the website according to the size of viewing screen. It helps the webpage to fit automatically in android, tablet or iphone.
Upvotes: 0
Reputation: 1437
Another article about meta viewport, its various properties, and how to use it in your designs is http://dev.opera.com/articles/view/an-introduction-to-meta-viewport-and-viewport/
There's also a slidedeck explaining things in detail and a Github repo to go with it.
Disclaimer: I'm the author of these resources.
Upvotes: 6