Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

meta name="viewport" doesn't work as expected

I have that meta tag in my website www.ssd-vergleichen.de

<meta name="viewport" content="width=device-width; initial-scale=1.0;"/>

To prevent the device from initial zooming into the website. When watching the website on my chrome mobile browser on Samsung Galaxy S2, the website is beeing zoomed in about 400%. What did I do wrong? Can anyone help?

Thanks in advance

Edit: With using

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

it works in Android's standard webbrowser, but still not in Chrome. I wonder if it works in IOS?

Edit2: No, it also doesn't work with iOS http://iphonetester.com/

enter image description here

like image 818
Stefano L Avatar asked Jun 21 '13 11:06

Stefano L


People also ask

Why viewport meta tag is 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.

Where do I put meta name in viewport?

Throw the viewport meta tag into your <head> , plus the @viewport rule into your CSS when you're building flexible layouts and you're good to go.

Is meta viewport necessary?

So yes, the meta viewport tag should be used on all websites and is mandatory if you want a good user experience. You may also need to use media queries to change CSS for different screen widths, like collapsing a menubar into a hamburger menu. The meta viewport tag won't do this for you, but you should.

Does not have a meta name viewport tag?

What does “No viewport meta tag on the page” mean? This means that the page in question does not contain a viewporttag. Consequently, users who have entered your site from a smartphone will see a page not adapted for their devices. In this case, the text will be unreadable.


2 Answers

Try this :

<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=320, height=device-height, target-densitydpi=medium-dpi" />
like image 117
Romain Braun Avatar answered Sep 28 '22 08:09

Romain Braun


Have you tried

<meta name="viewport" width="device-width">

As I understand it width="device-width" constrains the width of the layout to the device width. Surely setting intial-scale=1 is then telling the browser to zoom 100% (i.e. not scaled)?

Update

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

Is intended to be used to scale responsive sites correctly. Considering your site is fixed to a width of 1100px, setting initial-scale=1 will not result in the whole page being visible.

From the W3C Use Meta Viewport Element To Identify Desired Screen Size

like image 22
Colin Bacon Avatar answered Sep 28 '22 07:09

Colin Bacon