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 trialRamesh Kunwar
Courses Plus Student 4,066 Pointsmedia query
If I add a media query of min-width 480px and make its container width to 80% do I have to change it for devices which are more than 480px? or I should add a separate media query for those devices which are more than 480px.
3 Answers
Max S.
4,840 Pointsthere is a very easy way to understand min and max values. You always keep in mind that Min means minimum and max means maximum so when you add min-width:480px so it means the minimum size of screen 480px.
Below the 480px screen, this rule will be not applied.
Antti Lylander
9,686 Pointsmin-width 480px means that it will be applied to sizes GREATER or equal to 480px.
Ramesh Kunwar
Courses Plus Student 4,066 PointsIf I want to make the container width of 80% and padding of 1em on both mobile and desktop devices should I write it only on media query or I should also write it outside the media query?
Antti Lylander
9,686 PointsWrite it outside and it will be applied to all viewport sizes. Media query is used to change part of styling for certain display size.