So, what is a viewport?
The viewport for web design is defined as the rectangular area (measured in pixels) that is viewable on the screen and determines how the content is laid out and where text wraps or windows need to be scrolled to see the full webpage.
Isn't the viewport the same as the screen resolution?
For most devices the screen resolution/display size is equal to the viewport. This is true of desktop and laptop computers, however for mobile devices this may not be true!!
Many phone browsers scale web pages down to a wider viewport width to fit them onto the screen. This is sometimes called overview mode. These browsers allow the user to zoom in and scale the pages up to view the bit they want to see. For example, although a device screen might have a width of 320px the viewport can have a width of 980px. In this case a web page designed at 980px or less will fit completely on the screen.
The difficulty comes with different mobile devices and mobile browsers as they have different viewport sizes. Here is a short list of some popular mobile browser viewport sizes:
- Opera Mobile browser viewport 850px
- iPhone safari browser viewport 980px
- iPad (landscape & portrait mode) viewport 980px
- Android browser viewport 800px
- IE mobile browser viewport 320px
This graphic shows the implication of various viewports on three different devices for the Web Devil blog (click to enlarge):
How to change the default viewport?
So now we know that the new breed of mobile devices and browsers each have their own viewport, how do we change it? The answer is by using the viewport meta tag.
The viewport meta tag sits in the document head and is valid for these new devices.
It is possible to specify a fixed viewport (like the standard view of this blog):
<meta name="viewport"content="width=1100"/>
However for many webpages it's probably best to avoid hard coding a width. This is because you don't know what devices are being used to view the web page. Instead it's possible to define the default viewport width of the device:
<meta name="viewport" content="width=device-width"/>
It is also possible to change the scaling behaviour of the screen and whether the user is allowed to scale the page. Syntax for the viewport content includes:
- height = [pixel_value | device-height] ,
- width = [pixel_value | device-width ] ,
- initial-scale = float_value ,
- minimum-scale = float_value ,
- maximum-scale = float_value ,
- user-scalable = [yes | no] ,
- target-densitydpi = [dpi_value | device-dpi |high-dpi | medium-dpi | low-dpi]
Many phones have a different pixel density or dpi than the desktop 72dpi, so setting target-densitydpi=device-dpi is a good idea to prevent blurry images due to scaling effects.
The viewport meta tag for the touch sensitive sidebar version of this blog is:
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no, width=device-width" />
What about older mobile phones?
As previously mentioned, all of this only works for new mobile devices. The older blackberry doesn't support it - it needs:
<meta name="HandheldFriendly" content="true"/>
And the older Internet Explorer mobile needs:
<meta name="MobileOptimized" content="width" />
If you place all three meta tags (HandheldFriendly / MobileOptimized / viewport) then the mobile will pick the most current one that it understands.
For more details about targeting to the viewport of a device then the android developers guide has some good information at developer.android.com/guide/webapps/targeting.html
If you've read this far then hopefully you now know that in mobile web design a pixel used for design isn't necessarily a pixel on the device! To find out more about the size of various mobile device screens check out the following Web Devil post about mobile screen sizes.


Here is an interesting little tid-bit. Android (2.2) at least on my LG Optimus V phone will not allow scrolling it you use <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" /> as your viewport tag. Anyone else observe this. I guess that might be the point of the no-scale part. So what do we use for no-scaling but want scrolling? My pages work fine, you just can't scroll with the Android browser. Opera Mobile (on same phone) has no problem.
ReplyDeleteUpdate: found the holy grail for Android:
ReplyDeletehttp://developer.android.com/guide/webapps/targeting.html
Still working on this, but the answer seems to lie with using just:
<meta name="viewport" content="width=device-width" /> ...with or without initial scaling
-or-
<meta name="viewport" content="target-densitydpi=device-dpi, width=device-width" />
...which lets the page fill the viewport (as set to the device's physical screen width) at a browser defined screen density.
Since I size my pages before the browser gets them, I just want them to display at 1:1 scale. Seems like such a simple thing, doesn't it. But no....
Update No. 2
ReplyDeleteMy bad. I found the problem. I had an errant "overflow-x:hidden;" in my reset.css file. With some more Googling, I found that this is a known issue with Android browser (others?) that overflow:auto or overflow hidden don't work like they do in desktop browsing. Sorry for all the erroneous posting.
Thanks for the informative tips shared here! Got only positive emotions and dozens of ideas that could be useful for my blog.
ReplyDeletemobile website development
This is good information. I am glad to read such a nice content. Keep sharing more. Good luck.
ReplyDeletemobile web development
Thanks for the guidance.The coding lines are very important.Making the site specially for the mobiles is not an easy task.We need to minimize the size of the page and accordingly we need arrange all the components.
ReplyDeleteWebsite Design Bahrain
Really meaningful information about these applications and you are a great reviewer, I will definitely try these applications. Thanks a lot for spreading this information here.small business web design
ReplyDeleteTruly, this blog is very informative for Web design and about its creation...
ReplyDeleteI was looking a post like this before and I am very thankful that I found your blog. I will refer this to my friend. Thank you.
ReplyDeleteweb design Philippines
interesting blog. It would be great if you can provide more details about it. Thanks you
ReplyDeleteMobile Website Development
Hello, I love reading through your blog, I wanted to leave a little comment to support you and wish you a good continuation. Wish you best of luck for all your best efforts. Professional Web Designers In South Delhi, Best Web Designers In South Delhi.
ReplyDeleteGood design i like that and thank you for sharing the codes now it is so easy to use them ...
ReplyDeleteVertical Jump Bible
Thanks to provides a wide information about the mobile web design...
ReplyDeleteThanks for this informative post! I really appreciated it :) cafe24 extension installation
ReplyDeleteThe guidelines provided is awesome and must be followed to develop good applications. Thnaks for this. Iphone Development
ReplyDeleteGreat post! It is very informative and very useful, Thanks for sharing this interesting information.web banner design
ReplyDeleteI am happy to found your blogs.It is really great.I learnt new things from your website.I like your thoughts.Thanks for making such a cool post.
ReplyDeleteHire a magento developer
This comment has been removed by the author.
ReplyDeleteGreat resource for mobile designers, thank you for the information. Being cyber Monday, it will be interesting to see how mobile devices are used today.
ReplyDeleteWeb Services DFW
Paul -
Some people are confused with those two techie terms: viewport size and screen resolution. At least you helped them understand what each means.
ReplyDeleteJoana Leighmoore
Thanks for sharing your ideas and thoughts, i like your blog and bookmark this blog for further use thanks again… Website Development Melbourne
ReplyDeleteI just want to ask one question. If I will use a site builder in creating my site. Does it automatically fit on a resolution of a mobile phone? Thanks!
ReplyDeletey informative article you have got here. I love reading this kind of stuff. This is truly a great read for me. I hope to see more articles from you. web hosting companies
ReplyDeleteI would like to thank you for the efforts you have made in writing this article.
ReplyDeleteCreate an Online Store
Hi All,
ReplyDeletei am developing website for mobile with 320px width technology is Asp.Net,C# So i uploaded all my files on the sever when i am open my website on mobile "It is appearing too small every time i have to Zoom to see content and below horizontal bar is coming i dont want this horizontal bar And one more thing when i entered on mobile like www.example.com it should shift to m.example.com" if any one had faced these problems help me in this issues Thank you.
Thank you, for the great article....!
ReplyDeleteI was searching for the issue since last two days ...!
and finally i you , your article hepls me to get out of this viewport issue..
thanx a lot again
Thanks. Ill actually try and use a couple of these tips
ReplyDeleteWaiver forms
I liked this post very much as it has helped me a lot in my research and is quite interesting as well. Thank you for sharing this information with us.
ReplyDeletejewelry website design
Thanks for having this in your blog. This is very useful for the beginners.
ReplyDeleteWeb development
Attractive Website Design Services is the need of this technical era, every one is familiar with Online shopping and don't want to waste his/her time to go to store, all want to buy online, so Website structure and design play an important role in this manner. we offer Best Website Design Services for better business choice.
ReplyDeletethis blog is a nice posting.......
ReplyDeleteWebsite Designing Company
Having knowledge about screen resolutions especially on mobile devices can really make mobile web development easy because it won't provide any hassles to the task at hand...
ReplyDeleteWordPress Designers
I read your article and give very good informative...
ReplyDeleteOttawa website development
Hi friends for download latest movie click on : http://enttonight.blogspot.in/
ReplyDeleteVery good read. This is so important. Thanks for sharing those information! :)
ReplyDeletewordpress developer
Viewport web design in mobile phone is important especially in businessman who is on the go. Very easy and accesible they can monitor their business as early as possible.
ReplyDeleteSmall Business Web Design
I read your block it has to the point data and also it's show your effects.
ReplyDeleteonline sweepstakes
church software
blackjack software
I read your block it has to the point data and also it's show your effects.
ReplyDeleteonline sweepstakes
church software
blackjack software
I have read this post. collection of post is a nice one ..that am doing website designing company chennai india and website development company chennai india. That I will inform about your post to my friends and all the best for your future posts..
ReplyDeleteThanks for sharing information...
ReplyDeletewebsite design hawaii
Thank you for this post.I have read this post. collection of post is a nice one.
ReplyDeletehttp://www.propertygarh.com
If you've study this far then hopefully you now know that in cellular web style a pixel used for style isn't actually a pixel on the device.
ReplyDeletemicrosoft project 2010 training
Appealing information you have provided. It gained me more knowledge and idea. Please keep up the good because i like the way you are writing. Thanks!
ReplyDeleteweb design florida
Für die äußerst erfolgreichen Web Design.
ReplyDeleteweb tasarım fiyatları
Freelance Web Tasarım
nice information
ReplyDeleteProfessional business web design
he stuff here is really good and keep up sharing. i would like to thank you for the efforts which you have made in fabricated this article..Your blog is pretty good and impressed me a lot.
ReplyDeleteweb development
fantastic post and Thanks for sharing this info. It's very helpful.
ReplyDeleteweb agency brussels
Hello, I love reading through your blog, I wanted to leave a little comment to support you and wish you a good continuation. Wish you best of luck for all your best efforts.
ReplyDeleteUnitel Direct
Unitel Direct on Facebook
Wasp dudes! Awesome stuff keep it up.
ReplyDeleteclient satisfaction
hi i wolud like to appriciate your above post that was such a awosome one thanks Web Development India Web Development Company
ReplyDeleteYou guys out there are performing a great job.
ReplyDeleteweb design tulsa
It was a great opportunity to read your article, very informative. I learned new things here.
ReplyDeleteWebsite Design Company Philippines
Wonderful blog & good post.Its really helpful for me, awaiting for more new post. Keep Blogging!
ReplyDeleteWeb Design Chennai
Really Good One Dude.
ReplyDeleteReady Made Curtains Sydney
Good information for mobile lovers..
ReplyDeleteair conditioners gippsland
fujitsu split system
Online Marketing Dubai Email marketing is one of the most successful methods for websites to attract targeted leads to their website, not only building brand awareness, but also generating sales. The keys to a successful Email Marketing campaign are targeting the right audience and presenting a professional looking email. Coupled with an ongoing campaign the results can be extremely rewarding.
ReplyDeletejust linked this article on my facebook account. it’s a very interesting article for all...
ReplyDeleteWeb Designing
Hi there, awesome site. I thought the topics you posted on were very interesting. I tried to add your RSS to my feed reader and it a few. take a look at it, hopefully I can add you and follow...
ReplyDeleteWeb Development Company
This comment has been removed by the author.
ReplyDeleteweb agency roma è lo studio web del gruppo WdR Società che opera su internet a 360°.web design roma La web agency ha una sede a Roma ed una sede a trevignano romano , programmatore php roma
ReplyDeleteA mobile web design viewport on the screen can makes the whole application look attractive,even reflects on the content also. Magento Design India
ReplyDeleteThanks for introducing viewport! I think viewport provide good design to the site. Enterprise Mobile Apps and Beyond
ReplyDelete
ReplyDeleteThank you for posting such a useful, impressive.your blog is so beautiful. you have give me great news
website development company in gurgaon
Thanks for the valuable posting
ReplyDeleteby
desalination process melbourne
Thank you for this great posting
ReplyDeleteDrafting Services Perth
Building designer perth
Great website...and cool article man...thanx for the great post...keep on posting such articles..
ReplyDeleteSmallBusinessWebDesign
The topic is remarkable. I actually never think I could have an excellent read by this time until I find out this website. I am thankful for the information. Thank you for being so kind enough to have shared your information with us.
ReplyDeleteatlanta seo
Hi,
ReplyDeleteI will very thank to you that you shared more informative and very knowledgeable blog.Its great for me.My best wishes with you.
Keep it up.
Thanks.
Literature Review Example
Great post Dude. Thanks for sharing such an useful information.
ReplyDeleteThe viewport for web design is defined as the rectangular area (measured in pixels) that is viewable on the screen and determines how the content is laid out and where text wraps or windows need to be scrolled to see the full webpage. κατασκευή ιστοσελίδας
ReplyDeleteViewport is really an important factor when comes to mobile designing. Your post has really solved all the queries about it.
ReplyDeleteRegards,
Ekta - Hire Magneto Developer
Thanks ! for sharing this wonderful news with us.I really like your post as it is informative as well as interesting.I am also quite interested to see your upcoming post for Web Development so please keep writing.
ReplyDeleteMobile web design awesome information ..Thanks
ReplyDeleteWall Mount TV Installation Services Adelaide
Flat screen Installation
Thanks for sharing such an useful information.Certainly it will be a good post.
ReplyDeleteby
Personal Fashion Stylist Sydney
thanks for posting this content. its really good.6 months industrial training in chandigarh
ReplyDeleteThanks for the updates. It made a good read
ReplyDeleteWeb Designers Singapore
Hi,
ReplyDeleteYou have given very nice post it is very knowledgable and result oriented.
Website is very good tool for any company.
We are website designing company in delhi design good website, we develope website in RS.9999/-
Website Designing Company in Delhi,Website Designing in Gurgaon, Website Designing Company in Noida.
Hi, I went through your this post and found really interesting. I landed this page through internet search and found
ReplyDeletethis page very good.I am a web designer and works in a web design company
as a designer I liked the color of your blog also.
Thanks,
(Ronita Biswas)
Hi
ReplyDeleteHaving such website makes good business through impressing customers.
Web Design Company
Good information Dude..Thanks for sharing
ReplyDeletepergola and verandahs Adelaide
I like your informative and knowledgeable website
ReplyDeletegood idea in a stressful situation
Web Designer From India.
It’s a pleasure to visit this blog because it has a detailed structure. Simply Excellent.
ReplyDeleteMedia buying houses | Media buying houses in Pakistan
thanks, the blog good information and knowledgeable website.
ReplyDeleteI have recently Find Reviews Of Digest It, Acai Berry Select, Formax Diet, Good Morning Snoring Relief, Vigorelle, Virility Ex, Male Extra, Size genetics, Natox, Xtreme no, Digest It, Tinnitus Control and African Mango Plus
ReplyDeleteHi, I went through your this post and found
ReplyDeletereally interesting. I landed this page through
internet search and found
this page very good.I am a web designer and
works in a web design
company
as a designer I liked the color of your blog
also.
Thanks,
JIsha
I have just found the Press Releases and news about Green Coffee Bean Max, Zeta Clear, Provillus, Garcinia Cambogia Select, Raspberry Ketone Max, Breast Actives, Phen375, Triactol, Venapro, Wartrol and African Mango Plus on top Social media sites and Newspaper, so i thought to share it with you guys!
ReplyDeleteBen Bylett Landscapes is a highly qualified and accredited, professional, landscape design and construction maintenance business servicing across Mosman and North shore.
ReplyDeletedecking northern beaches
Ben Bylett Landscapes is a highly qualified and accredited, professional, landscape design and construction maintenance business servicing across Mosman and North shore.
ReplyDeletedecking northern beaches
Dr. OZ has recently endorsed 4 products on his Show as best Fat Burner Supplement for quick and Safe Weight Loss! Garcinia Cambogia Select, Green Coffee Bean Max, Raspberry Ketone Plus and African Mango Plus are Those Top 4 Dr OZ Weight Loss Pills!
ReplyDeleteHere the post discussed many issues of the mobile site and has better understanding with such technical factors. So in the same order the people go for mobile website development services to capture more visitors from the online market.
ReplyDeleteGreat Blog . Thank U
ReplyDeleteBathroom renovations Adelaide
pergola and verandahs Adelaide
Garcinia Cambogia Select is a breakthrough medical discovery in natural health and wellness and in sustainable fat loss and weight loss. Garcinia Cambogia is a weight loss and eating disorder remedy. It is a safe and effective non-stimulant that is made from all-natural fruit extracts that are being used at a low or high dosage depending upon the desired result. Garcinia Cambogia Select leads in melting off the awful inches from your waist. It makes you attain the desired shape and a gorgeous flat belly that you have always dreamt of! The Garcinia Cambogia Extract could be the most recent fat loss solution which comes highly recommended by non other that Dr Oz in fact he calls the Garcinia Cambogia Extract the Holy Grail Of Weight-loss. For more review about Dr OZ Garcinia Cambogia Select, Visit www.garciniacambogiaselects.com or find complete Garcinia Cambogia Select Review at http://www.prweb.com/releases/garciniacambogiaselect/reviews/prweb10331994.htm
ReplyDeleteThis blog gives the light in which I can observe the reality. This is very nice one and gives useful information. Thanks for this nice blog.
ReplyDeleteWeb Design Company
It really shows me where to expand my blog. I think that sometime in the future I might try to write a book to go along with my blog, but we will see. mobile website design
ReplyDeletevery good information Shared..
ReplyDeleteBathroom renovations Adelaide
pergola and verandahs Adelaide
Provillus is rated hair loss product of the year for men and women hair loss! Provillus is FDA approved solution to stop hair loss and regrow hair back! Read Provillus review before order at www.managehairloss.com
ReplyDeleteThanks for sharing your ideas and thoughts Mobile Website Development
ReplyDeleteAll posts have something to learn. Your work is very good and I appreciate you and hopping for some more informative posts.
ReplyDeleteThank you…….. Great blog.
airport pickup w2 |heathrow to w2 | southend to w2
This post have great information to grab the knowledge ... Thanks for sharing dude
ReplyDeletecommmercial cleaning morayfield
I wanted to thank you for this great blog! I really enjoy every little bit of it and I have you bookmarked to check out new stuff you post.airport pickup w2 | southend to w2
ReplyDeleteBoost your web site to the top results of the largest search engines. We provide organic traffic based on specific keywords that you choose. Limited offer promotion, get $25 worth or organic visits using the coupon code KiWI-25-Organics
ReplyDeleteBoost your web site to the top results of the largest search engines. We provide organic traffic based on specific keywords that you choose. Limited offer promotion, get $25 worth or organic visits using the coupon code KiWI-25-Organics
ReplyDeleteGood information..Thanks for sharing the article dude.
ReplyDeletepest control brisbane
Thank you for sharing. Mobile Website Design is critical for your business!
ReplyDeleteGarcinia Cambogia Select Reviews - Garcinia Cambogia - Garcinia Cambogia Reviews - Garcinia Cambogia Extracts - Garcinia Cambogia Dr Oz - Garcinia Cambogia Weight Loss - Garcinia Cambogia Extracts Reviews - Dr Oz Garcinia Cambogia - Garcinia Cambogia select - Garcinia Cambogia Fruits - Garcinia Cambogia Extracts Weight Loss - Buy Garcinia Cambogia Extracts - Where to Buy Garcinia Cambogia - Garcinia Cambogia Extract - Dr. OZ Garcinia Cambogia Weight Loss - Weight Loss Garcinia Cambogia
ReplyDeleteGreat post. Thanks for sharing.
ReplyDeleteCRM Development
such a nice aritcle, please keep sharing the information about Mobile application development and Website Building Services
ReplyDeleteThanks for sharing this great article dude
ReplyDeleteWeb design company in bangalore
Thanks for sharing this great article dude Web design company in bangalore
ReplyDeleteAs mobile application development and mobile website development is powerful tools for a business, you are guiding developers about how to design or develop websites according different devices. Really very nice work. Thanks
ReplyDeleteThanks for sharing this post..
ReplyDeleteAdorn web Design Company In India
Thanks for sharing this great Post dude
ReplyDeleteWeb design company in bangalore
Thanks for sharing such a vital information on viewport META tag. This article and its content was really helpful for me in upgrading my knowledge.
ReplyDeleteWeb Design Company India
Your blog is very informative and gracefully
ReplyDeleteyour guideline is very good.Thank you
Engineering college
Best engineering college in india
Private engineering college
pharmacy college
pharmacy college in india
top pharmacy college
Polytechnic college
Top polytechnic college
Top private polytechnic college
Top polytechnic colleges in India
Techanical colleges
Polytechnic college in india
Leading call center
Outbound call center india
Cheap Seo services india
Web Design Delhi The organizations which are doing web design and web development services in India are playing a great role in Indian business and economy
ReplyDeleteHey my friends I tell you some tips. A simple website design shouldn’t be a daunting all-or-nothing ordeal – you can simplify your design by taking small steps. Simple tasks like putting the focus only on the essential elements of your website, getting rid of the unnecessary, reducing the number of pages your site has, getting more content above the fold, and limiting the number of colors you use. You can always fine-tune and improve your simple design, but the important thing here is to get started.
ReplyDeleteNewcastle web designer
Thanks for sharing this post.
ReplyDeleteGreat Post
ReplyDelete