Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I make the Android browser render my document at the screen's size?

I'm working on a site that's supposed to scale fluently down to low resolutions, so that it would work just as well on a phone. This works well in Firefox and Chrome when I just make the window small, but when I try it out on an actual Android phone (Nexus One running Android 2.2), it renders it super-huge! (Using JS's window.innerWidth and window.innerHeight properties, it seems the viewport resolution it reports is 800x1271!)

Is there a way to render the page at actual-size in the browser window so I can have my full design show up on the phone? User-agent sniffing is allowed, JS is allowed but discouraged.

like image 320
MiffTheFox Avatar asked Feb 27 '23 12:02

MiffTheFox


1 Answers

Resolved on my own. The solution is to add the following code to the header:

<meta name="viewport" content="width = device-width">
like image 89
MiffTheFox Avatar answered May 01 '23 05:05

MiffTheFox