Viewport

What we really want if we’re to target as many devices as possible is to get back to the definition of a reference pixel. This can be done with thedevice-width value:

<meta name=»viewport» content=»width=device-width» />

This declaration effectively says «the layout of this page is flexible enough to adapt itself to various screen widths, so please use a viewport width that makes the content readable». You should set this declaration in all mobile-friendly Web pages. You may want to complete the declaration as follows:

<meta name=»viewport» content=»width=device-width,initial-scale=1.0″ />

The second parameter tells the mobile browser not to zoom in/out by default when they render the page, in effect adding «… and I mean it!» to your declaration because some browsers may still decide that they need to zoom out for some reason.

Tagged:

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.