Viewport Meta Tag For Non-Responsive Design 184
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">
I just want to thank you for sharing your information and your site or blog this is simple but nice article I’ve ever seen i like it, I learn something today.
Thanks
Web design company Hertfordshire
Nice article dud!!! thanks
This is easier and surely gives comfort to internet users. Thanks for sharing. Post like this offers great benefit.
Thank you!
WOW.. this is really nice share. I just want to say thanks for this post.
I just want to say thanks for sharing. It’s very useful.
I think its very important to add a view-port meta tag when coding for a website as this tags makes your website mobile friendly.
I totally agree with businessfied. It is very much necessary to add a view port meta tag.
Regards
Great quick tip. Thanks for the code, this will come in handy until I start getting into responsive design.
very interesting and I am wondering if you think this might work for desktop versions of Ning networks. It would be very useful to the millions of ning creators who have unresponsive designs…
any ideas?
Good share – again it is important for designers to realize that responsive design is here to stay as there are so many mobile users nowadays.
The article about website designed is a very great.I think everybody should follow the article.
Thank you fir share it.Website Design Dubai
amei seu blog usarei seus tutoriais para personalizar meu blog amei ..!
amei o blog..!
Wow. I didn’t think of that before. Thanks. This is really useful.
Thanks for sharing this post to us! This is cool and useful!
thanks for sharing!!!
Thanks for sharing this article. It’s good to see the examples as I’ve seen quite a few sites without the viewport tag. Much appreciated!
who knew you could do so much with the viewport tag, thank for sharing!
Hi there!!
Thanks so much for sharing relevant information.
Thanks. This is really useful.
well done, I now learned the importance of viewport.