Class Act

Back to the shelf

HTML · Snippet · ASP.net

viewport meta, mobile width

The HTML viewport meta tag that tells mobile phones to use the actual screen width instead of pretending the page is a wide desktop.

Example

How to use viewport meta, mobile width:
Paste the markup into the page and open it in a browser.

Notes

Without it, phones lay the page out at desktop width and scale it way down — making everything tiny and hard to tap. Put this tag in the <head>.

Code

<meta name="viewport" content="width=device-width, initial-scale=1" />