Apparently, the author of a well-designed page can add
a <meta>
element to
tell (only) Mobile Safari to offer less space than the
default 980:
<meta name="viewport" content="width=320">
But if Mobile Safari can cope with pages wider than
980px when that is its minimum, it ought to be able to
cope with them just as well if it initially offers
something much narrower. Why doesn't it simply use 320px
as its default instead? (I assume that medium
text in a virtual image of that size
is readable at the default zoom level; if not,
re-configure minimum virtual image size or the default
font size by an appropriate factor.)
You could argue that authors are responsible for
routinely adding the <meta>
al ĉiuj iliaj paĝoj se ili
postulas ke tiuj funckiu sur iPhone, but:
-
No! They are only responsible if they diverge from defaults.
A page that is already width-agnostic should not have to sacrifice that just to work well in an iPhone.
-
What size should they specify? What happens to the page when viewed with the next version of the device (or a rival) with a 20% bigger screen? The browser is best placed to know what is a good default minimum, so let it specify.
Solving the problem just for one particular browsing environment is not scalable.
There is no need for an author to specify a width, because the virtual-image mechanism above copes fine with pages that demand more width than it offers by default. Just get the default right in the first place! Reconfiguring the device to a more ‘honest’ default will make width-agnostic pages display better, while not breaking the fixed-width and width-hungry sites.
To demolish my thesis, you need to find a site that operates better in a configuration other than 320px as an initial virtual viewport width. Here's how to do a test:
-
Download the raw HTML of the page. You could download the images too, but it's not normally necessary.
-
Edit the file so that it contains the following line at the start of the
<head>
element:<base href="the page's address">
You need to fill in the page's real address, of course.
-
Elsewhere in
<head>
, find a<meta>
viewport element:<meta name="viewport" content="something">
If it doesn't exist, simply add it with the following setting:
<meta name="viewport" content="width=320">
Otherwise, set it to that.
-
Make sure there are no other
<meta>
viewport settings. -
Publish the page somewhere so you can view it with an iPhone, and compare it with the original page.
You might notice a difference during loading, but is the original better than the adjusted copy when the page is fully rendered?
Update, 2011-01-23: It seems that
there is a straight-forward solution to this problem
using the <meta>
element above:
<meta name="viewport" content= "width=device-width; initial-scale=1">
Yay! Now you can set the viewport width to the actual device width! Why isn't this the default? I shouldn't have to set it on all my websites. Oh well, at least it's width-agnostic.