Knowledge Base Overview

Viewport Meta

I see a lot of questions in forums and other places about the viewport meta tag for Android or they like to know if there are any Android specific meta tags.

It seems people are puzzled with meta tags for smartphones and Android devices in particular. So let me shed some light on this topic real quick.

A viewport is a browser

First and foremost we have to get one thing out of the way which is the Android phone. When we surf the web on a smartphone we get an HTML page and this page is rendered by what we know as a viewport. The simple answer to what a viewport is: On a smartphone a viewport is a browser! Dead simple—the same as on your computer.

This should already answers the question if there are any Android specific meta tags. No, there are no Android specific tagsper se because the phone is just a computer and it is the responsibility of the viewport, aka browser!

If you only use or think about the pre-installed browser on your Android phone then it might look like it is a Android specific meta tag but ... you can install other browsers and meta tags are in fact a viewport (browser) specific thing.

So, if you really want to understand what is going on with a webpage on a smartphone like an Android you have to understand the viewport!

The term viewport has been specified in the CSS2 specification, Section 9.1.1 which quite frankly was a long time ago. All applications interpreting HTML or CSS documents are called user agents and grouped into media types. One group is labeled as continuous media and these devices are called viewports in the specification.

Continuous in the specification means you can scroll the pages and view the page on a screen. The application in this case are of course browsers and that's where the confusion for some people begins.

A smartphone is a computer

Many people still see their smartphone as a cell phone and not what it really is: a computer which is also a phone. The phone is actually an application running on a small handheld computer.

If you watch a video or listen to music you are using a media player application. You install apps on your smartphone. The thing you are using to browse the web is—well an application known as a browser. Most Android smartphones have pre-installed the default Android browser but you can install other browsers. Just go to your Android Market and search for browser. You will find browsers like Firefox, Skyfire, Dolphin, Opera Mini, Fennec and some others.

The viewport meta tag

Finally the question about the meta tags and probably the real source for the confusion—the viewport meta tag. I see the following questions a lot:

"Does Android support the viewport meta tag"

"Are there any Android specific meta tags"

As we have just learned these questions are not correct and cannot be answered. The meta tags as you may know are part of the head section inside the HTML document. Hence, it has nothing to do with the device. It is safe to assume that today all browsers for Android smartphones support the viewport meta tag but that there are probably no other specific tags.

If you have a Android device you can do some tests on my Viewport Demo web page.

If you like to know more about the viewport I have some other pages you might be interested in.