I have a layout:
The problem I face is that it's too wide. I need it to be max 640px wide.
I know how to set CSS that defines a max width, but then what happens is that the layout is capped at 640px, and it is NOT SCALED. So I'm left with empty space.
The screenshot is of Nexus 7 with a high resolution. I want to set my layout to max 640px, and SCALE IT UP to the screen size.
I tried:
<meta name="viewport" content="width=640, maximum-scale=2, minimum-scale=1">
And it worked perfectly, I saw a 640px wide layout scaled to the screen. HOWEVER, it looks horrible on smaller resolution devices like iPhone 5, because it forces iPhone to have 640px wide viewport.
Is there a way to have a min 320 - max 640 pixel wide layout, depending on mobile screen resolution, and then have it be SCALED to the screen instead of leaving empty space?
Here's an example:
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=200">
<style>
body {
background: green;
width: 200px;
}
</style>
</head>
<body>
<div style="background:red; width: 200px; height: 200px;">
</div>
</body>
</html>
It looks like this: http://d.pr/i/LOZ7
How do I make the red fill the screen? How do I make it scale up so that it's horizontally filled?