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
Chanel Allen
2,746 PointsFlexbox and Media Queries
Once more browsers are be able to to support Flex Box will Media Queries still need to be used or no because Flex Box naturally moves the items based on the size of the browser window.
2 Answers
rydavim
18,814 PointsI would not expect flexbox to displace media queries. The biggest reason being that media queries are not only for positioning layouts.
For example, you could also hide certain content completely on smaller screens. You can use media queries to change your presentation to remove large images and color when users try to print your web pages. You might want to change certain colors to have higher contrast on smaller devices.
There are a lot of reasons to use media queries that aren't directly related to responsive layout. Flexbox might simplify some of the layout-heavy queries, though.
Chanel Allen
2,746 PointsThanks for your answer I understand now. One last question. And with Flexbox this could be used instead of having to use the box model then.
rydavim
18,814 PointsAll html elements, including flexbox elements, can be considered as boxes. The box model will still come into play when using flexbox, since those still have content, padding, borders, and margins, they're just being dynamically resized.
Changing parts of the box model like padding and borders will still have a visual impact on flexbox elements. The box model is really just a way of visualizing the way html elements work. The w3schools page is my favorite resource for quickly reviewing the box model.