Tuesday, March 27, 2012

Mobile web beginner



Mobile web development is as simple as web development for desktop but programmer should consider the basic thing i.e. device size and design pages accordingly more ever developer has to follow some guide lines

1) Add meta tag for view port

A typical mobile-optimized site contains something like the following:



The width property controls the size of the viewport. It can be set to a specific number of pixels like width=600 or to the special value device-width value which is the width of the screen in CSS pixels at a scale of 100%. (There are corresponding height and device-height values, which may be useful for pages with elements that change size or position based on the viewport height.)

The initial-scale property controls the zoom level when the page is first loaded. The maximum-scale, minimum-scale, and user-scalable properties control how users are allowed to zoom the page in or out.

This will fix the page render problems on mobile devices
ex:-

first image is with meta tag viewport and second is without meta tag