Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS CSS Basics (2014) Enhancing the Design With CSS Adjusting the Layout with Media Queries

Does adjusting the browser window change the value of the 'viewport'?

.

2 Answers

Louise St. Germain
Louise St. Germain
19,424 Points

Hi Amandeep,

Yes, you can change your viewport size by resizing the browser window. The website What is my Viewport is a neat way to see this in action if you want to try it out: it tells you how big your viewport is, and if you resize your browser window, you will see it update in real-time with your new viewport dimensions.

I hope this helps!

Mark Wilkowske
PLUS
Mark Wilkowske
Courses Plus Student 18,131 Points

Hi Amandeep, the media query is the definition. @media (max-width:600px){} means: when the viewport is from 1px to 960px the rules in the media query apply. When the viewport is 961px and larger the rules do not apply. Think of the viewport as the browser's width.

.