Viewport Meta Tag For Non-Responsive Design 177
I'm sure you all are using viewport meta tag for responsive design, but did you know that the viewport tag can also be very useful for non-responsive design? If you haven't got the time to convert your design to responsive yet, you should read this article on how to use viewport tag to improve the appearance of your design on mobile devices.
General Use of Viewport Tag
Viewport meta tag is generally used for responsive design to set the viewport width and initial-scale on mobile devices. Below is a sample viewport tag.
<meta name="viewport" content="width=device-width, initial-scale=1.0">
Using Viewport Tag for Non-responsive Design
As you may know, the default viewport width on iPhone is 980px. But your design might not fit in that range. It could be wider or narrower. Below are two examples where you can utilize the viewport tag to improve the rendering of non-responsive design on mobile devices.
Example
Take a look at the Themify site on your iPhone.
The screenshot on the left shows how the site would render without the viewport tag. As you can see, the page is touching on both sides. I added viewport tag to specify the viewport width to 1024px so it leaves some margin space on the left and right sides.
<meta name="viewport" content="width=1024">
Another Example
If your design is too narrow, it might also cause an issue. Lets say the container width of your design is 700px and it is not responsive, it would look like the screenshot on the left where there is a big empty space on the right.
You can simply fix this by setting the viewport width to 720px. The width of your design doesn't change, but iPhone will scale it to fit in 720px.
<meta name="viewport" content="width=720">
Common Mistake
A common mistake is that people often apply initial-scale=1 on non-responsive design. This will make the page render at 100% without scaling. If your design is not responsive, users would have to pan around or zoom out to see the full page. The worst case is combining user-scalable=no or maximum-scale=1 with initial-scale=1. This will disable the scaling and zooming capability of your site. With scaling disabled, users have no way to zoom out to see the complete page. Remember: if your design is not responsive, do not reset the initial-scale or disable scaling!
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
Thanks you so much cause you post these excellent design. .i will share these to my web. .
Brilliant concept and great information..
very interesting post, thanks for sharing.
Well written and informative, but a small lol at the code snippets on this article rendering to beyond an iPhones viewport and so being chopped off (in both portrait and landscape)
Nice article posted by you,Its very helpful to online users.We also providing the same services in Dubai like Internet marketing and Seo services.
Some time I need disable auto scale website function of device (with Apple it will scale to 980px), I use meta tag viewport. It really useful
Great tips in this post. I use viewport to hide or position fixed width images… call it a responsive hybrid.
I will try this meta tags for non responsive design :)
I been using this viewport tag for some time now and I must say that its quite handy. Easy way to convert a website for responsive :)
官路风流 侯卫东官场笔记
Very interesting post, thanks for sharing.
http://www.seotukhoa.vn
Very informative. Thanks!
What i don’t realize is in fact how you’re not really a lot more
neatly-preferred than you may be now. You’re very intelligent. You understand therefore considerably with regards to this topic, made me individually consider it from a lot of varied angles. Its like men and women aren’t fascinated
unless it is one thing to do with Woman gaga! Your personal stuffs excellent.
All the time maintain it up!
Here is my website; http://www.chrisgardnermedia.com
Very interesting and informative..Thanks
Viewport meta tag information is really helpful..thanks
I have been searching for a solution to this for awhile now and will be using this to help me deliver a responsive design for my client who wants a cross device site.
Although the “initial” viewport is helpful, but i think designers shouldn’t take it too far and limit the “maximum” viewport value. The user is supposed to remain in control of their view, and i believe this whole viewport handling should be set by the mobile browser to best view a webpage (like a setting).
Thanks for another great article, as usual!
This is a marvelous post! I had problem with background images not showing on mobiles and tablets for non-responsive websites. With the tip about the viewport (width=1024), it’s fixed!
Thanks again.
Will try this out.Thanks for the post
Wow, I had no idea that it really made a difference. Very informative. I’ll definitely be surfing through your blog for more keen information. Thanks!!