Want to highlight a helpful answer? Upvote!

Did someone help you, or did an answer or User Tip resolve your issue? Upvote by selecting the upvote arrow. Your feedback helps others! Learn more about when to upvote >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

viewport doesn't work

I can't get the viewport to work on anything. I've read all of the webkit, iPad, safari, iOS, and android documentation on the matter as well as visited a lot of forums and blogs about it. They all pretty much say the same thing but it does not work.



Using this code I get the following in the browser window. This happens on an iPad, android tablet, and Safari. It would be shorter to tell you what browsers it does work in, none.


<!DOCTYPE html>

<html>

<head>

<meta charset="utf-8">

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

<title>Viewport</title>

</head>

<body>

<img src="dims.gif" alt=""/><img src="dims.gif" alt=""/><img src="dims.gif" alt=""/>

</body>

</html>


User uploaded file


Any idea what I am doing wrong or what can be done to fix this?

iPad

Posted on Dec 9, 2011 8:58 AM

Reply
1 reply

Dec 27, 2011 6:52 AM in response to destryalhmns

I finally figured out something.


You can try this at home. The viewport tag is not respected for me when ran locally. However, I uploaded the same page to my website and tried it there and when you access the page from the website it DOES work. I got the idea from some article I found about iPad not respecting viewport if it's local or something.


What I can get to work: user-scalable, initial-scale

What doesn't seem to change no matter what I do: width, height


Cross reference with this doc: http://developer.apple.com/library/IOs/#documentation/AppleApplications/Referenc e/SafariWebContent/UsingtheViewport/UsingtheViewport.html

viewport doesn't work

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.