Skip to content

Instantly share code, notes, and snippets.

@0xjjpa
Created February 3, 2014 15:08
Show Gist options
  • Save 0xjjpa/8785503 to your computer and use it in GitHub Desktop.
Save 0xjjpa/8785503 to your computer and use it in GitHub Desktop.
Meta tag for designing on a 640px mobile screen, targeting the font to then match it unless it's an ipad.
<meta id="viewport" name="viewport" content="width=320, intial-scale=0.5, maximum-scale=.5, minimum-scale=.5, user-scalable=no"/>
<script>
(function(doc) {
if (navigator.userAgent.match(/iPad/i)) {
doc.getElementById("viewport").setAttribute("content", "initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no");
}
}(document));
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment