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 trialEmmanuel Rojas
6,994 PointsBreakpoints
Hi! I'm still trying to get the breakpoints, using min-width in my media queries make sense, but using max-width do not make any sense. My understanding is if my max-width is 768px, and my device is smaller than that, my device is going to read that media queries too, because max-width goes from 0 to the breakpoint, in this case, 768px. Am I right?
1 Answer
Manav Misra
11,778 PointsYes, you are correct.
Generally, we don't use max-width for media queries. Only min-width. The reason why is related to mobile-first design (https://teamtreehouse.com/library/how-to-make-a-website/css-cascading-style-sheets/take-a-mobilefirst-approach).
Essentially, your base rules (no media query) applies to all situations (including mobile). Then, you add additional rules at certain 'min-width'(s), depending on your design.
So, using 768px (BTW, don't get 'brain-washed' by this number. Pay attention to your actual design requirements), for example, means that on a 'small tablet,' the design will be progressively enhanced to take advantage of more screen space.
For example, maybe the 'base' navigation menu is 'collapsed,' and then changes to tabs as these CSS rules 'kick in' at min-width: 768px.
Emmanuel Rojas
6,994 PointsEmmanuel Rojas
6,994 PointsThank you very much.