cusejuice
cusejuice

Reputation: 10671

Coding a mobile site initial approach

I'm working on coding a mobile-dedicated website (i.e. m.example.com), based on a design with a width of 640px.

How do I go about starting to code a mobile site in terms of:

  1. the meta viewport
  2. pixel-based widths

Which viewport do I go about using? I've seen many arguments online about the differences between:

  <meta name="viewport" content="width=device-width, user-scalable=no">

and

<meta name="viewport" content="width=device-width, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">

Also, do I set the body width in percentages or set it to a fixed width for mobile, like 320px? How do I take a design that is designed at a width of 640px to properly display at 320px?

Upvotes: 1

Views: 116

Answers (1)

arbbot
arbbot

Reputation: 303

I would actually just use the following:

I guess that you could still set the width to the device specific width, along with the initial and maximum scales.

Honestly, I don;t think that including user-scalable makes any difference.

I have tested the above on iPhone, Android and Windows Phone and it works like a charm.

Upvotes: 1

Related Questions