by Prasanna Vignesh
14. February 2008 05:17
Most websites and web pages will be compatible and work fine on iphone and Blackberry. However, it’s still possible to make the web sites more
supportive, ready and friendly to Apple iPhone by giving more
information to iPhone about how the webpage should be displayed on the
iPhone browser. Beside, for web sites that try to emulate the
functionality of the built-in iPhone applications such as webapps that
use Canvas, AJAX functionality and limit the size of the page to 320×480px (or
480×320px), it’s best to ensure iPhone and Blackberry compatibility to
ensure that the page is rendered and formatted correctly and avoid
problem such as web page or application not scaling properly when rotate and Safari browser zooming out.
One of the best way with just one line change on website coding to make
website and web app support iPhone and Blackberry is by telling the PDA
phone of the viewport size of the overall page. To do so, simply add
the following line to the HTML HEAD section of the web page:
<meta name=”viewport” content=”width=320″ />
viewport is visual formatting model for visual media in CSS 2.1
specification, where it is a window or other viewing area on the screen
through which users consult a document (mean part of the screen that
you’re actually seeing). User agents may change the document’s layout when the viewport is resized. Other parameters applicable for viewport
include initial-scale, user-scalable, minimum-scale and, maximum-scale
where you can try to make your website fit into iPhone and BlackBerry
view area. The example of usage:
<meta name=”viewport” content=”initial-scale=1.0″ />
<meta name=”viewport” content=”user-scalable=false” />
You can mix the setting u want to use into a single META HTML code such as:
<meta name=”viewport” content=”width=320,user-scalable=false” />