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 Layout Techniques Grid Layout Testing our Grid

Mario Zampollo
Mario Zampollo
11,292 Points

min-widht & min-height

I am just trying to figure out why in the final css file the first media query contains the "min-with: 1px" condition. Is the "max-with: 767px" condition not sufficient to set styles specifically for small devices?

I refer to:

@media (min-width: 1px) and (max-width: 767px) { ... }

Hi Mario,

Does Guil ever type this in during the video or does it just appear at some point with no explanation?

I would think that max-width would be sufficient but perhaps there's a reason to do it that way.

Mario Zampollo
Mario Zampollo
11,292 Points

Yes, I think so too. Anyway, it is just something that I have found in the css file included in the project files. I have figured out that this media query is set to apply certain rules only on small devices, but I thought that the second condition would have been sufficient for that purpose. Thanks a lot for your reply!

2 Answers

Nicholas Olsen
seal-mask
.a{fill-rule:evenodd;}techdegree
Nicholas Olsen
Front End Web Development Techdegree Student 19,342 Points

My experience tells me "min-width: 1px" is not required. I can only guess they included it for clarity, otherwise there really is no reason to include it at all.

Mario Zampollo
Mario Zampollo
11,292 Points

Perfect, I was afraid I was missing something. Thanks for your reply, I really appriciate.