Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Showing mobile friendly web page without having to zoom in

I'm trying to create a mobile friendly web page using the code below. When I view it over a HTC desire I have to zoom in to see the correct size. How can I get it to display normally without having to zoom in?

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="MobileSite._Default" %>


<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.2//EN" "http://www.openmobilealliance.org/tech/DTD/xhtml-mobile12.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >

<head runat="server">
    <title>My Mobile Site</title>
</head>
<body style="width: 480px">
    <form id="form" runat="server">
    <div>    
        Test<br />
        Test<br />
        Test
    </div>
    </form>
</body>
</html>
like image 868
Grant Avatar asked Feb 28 '23 03:02

Grant


1 Answers

I'm not sure if the HTC supports the viewport meta tag the same way the iPhone does, but you can try:

<meta name="viewport" content="width = 320" />

(or some other width) or:

<meta name="viewport" content="initial-scale=1" />
like image 133
Matt Bridges Avatar answered Mar 06 '23 16:03

Matt Bridges