What does the following meta tag do?

Questions & AnswersCategory: Programming LanguageWhat does the following meta tag do?
Adam asked 3 years ago

What does the following meta tag do?

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

a. Tells the browser to look for media queries in the CSS file
b. Makes the web page responsive automatically
c. Prevents browsers from scaling desktop websites on mobile
d. None of the above options are correct

1 Answers
Lokesh Kumar Staff answered 3 years ago

c. Prevents browsers from scaling desktop websites on mobile
Explanation: the meta tag – <meta name=”viewport” content=”width=device-width, initial-scale=1″> gives the browser instructions on how to control the dimensions of a page and the scaling in it.
Here, the width=device-width part sets the width of the page to follow the screen – width of the device that will vary depending on the device.
The initial-scale=1.0 part sets the initial zoom level when the page is first loaded by the browser.
Therefore, this meta tag prevents the browsers from scaling desktop websites on mobile.