Last Updated: April 23, 2019
·
5.604K
· MikeRuby

The correct meta viewport syntax

It's not uncommon to come across two slight variations on the syntax for declaring meta viewport content values. It should be noted that only one is correct, and using an incorrect syntax can actually create problems in certain web browsers.

This is the correct syntax:

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />

This is the incorrect syntax:

<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" />

Notice the correct syntax uses comma separated values. The incorrect way is to use a semi-colon as separators.

For more info on this go to: (http://dev.w3.org/csswg/css-device-adapt/)