The viewport meta tag
When Apple released the iPhone in 2007, they introduced a proprietary meta
tag called the viewport meta
tag. Its purpose was to provide a way for web pages to communicate to mobile browsers how they would like the web browser to render the page.
Without this meta
tag, iPhones would render web pages as a 980px wide window that the user would then have to zoom in or out of.
With this meta
tag, it's possible to render a web page at its actual size and then adapt the layout to provide the kind of web page we now all expect to see when we browse the internet on our phones.
For the foreseeable future, any web page you want to be responsive, and render well across small screen devices, will still need to make use of this meta
tag as Android and a growing number of other platforms also support it.
As you are now aware, the viewport <meta>
tag is added within the <head>
tags of the HTML. It can be set to a specific width...