Welcome to the Treehouse Community
Looking to learn something new?
Claudine Bananal1,756 Points
Viewport Meta Tag
So in the video, it says that we use the viewport meta tag because without it, the desktop layout will be rendered in mobile devices. I was wondering why when there's already declarations stated in our media queries? I thought these media queries specifically tells the site what to do depending on the user's browser's size.
Kevin Korte28,135 Points
The viewport meta tag sets the viewport. The most common is to set the viewport to the devices width. When media queries know how wide the viewport is, they can act and react.
When the viewport isn't define, there isn't anything to trigger the media query fire.
The meta viewport tag creates "sidelines", and the media queries play within those sidelines to keep from going out of bounds. Without there are no sidelines, just a big wide open field, nothing to every call out of bounds on.
Does that make sense?
Dan Henning8,691 Points
I think Kevin is correct: the viewport contributes to other design decisions that we make, including media queries. There must be a base to start from. From that point, we make adjustments according to screen width, orientation, and other considerations.
If you really want the nitty-gritty details, please read "A Tale of Two Viewports (Parts One and Two)": http://www.quirksmode.org/mobile/viewports.html