Internet Explorer and HTML Controls Exception

4/8/2010

HTML layouts are an exception to the rule that all pixel coordinates should be scaled. On Windows Mobile Professional and Windows Mobile Classic, Internet Explorer interprets pixel coordinates in HTML specifically as 96-dpi pixels. Although it is always best to use relative coordinates in HTML, such as defining a table column as 50 percent of the table width, if you are currently using pixel metrics, they will continue to produce the same layout at higher DPI.

The same is not true for Windows Mobile Standard; on these devices, pixel coordinates will continue to refer to actual pixels. For this reason, a high-resolution Windows Mobile Standard device will display more Web page content and possibly render the Web page differently than would a low-resolution Windows Mobile Standard device.

The screen size can be determined on the device side by means of the window.screen.width and window.screen.height Microsoft® JScript® development software variables. If you would like to know the device's screen size on the Web server side, you can query the HTTP_UA_PIXELS header.

See Also

Concepts

Developing DPI Aware Applications
High DPI Display