<meta name="viewport" content="width=device-width, initial-scale=1">
What is actually happening on put this meta tag to the header?
<meta name="viewport" content="width=device-width, initial-scale=1.0">
A
<meta>
viewport element gives the browser instructions on how to control the page's dimensions and scaling.The
width=device-width
part sets the width of the page to follow the screen-width of the device (which 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.
That code only affecting view on mobile browser. You can see difference on mobile browser.
If you put that code into header, your view on any mobile browser will not same like view for desktop. But the view will changes according your device width.
Mobile Safari introduced the "viewport meta tag" to let web developers control the viewport's size and scale.
ex:-
<meta name="viewport" content="width=device-width, initial-scale=1">
Sources:- MDN, developer.apple