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 Flexbox Layout Building a Layout with Flexbox Creating a Three Column Layout with Flexbox

Kymane Llewellyn
Kymane Llewellyn
10,603 Points

Flex-box order?

How come when Guil changes the flex-box order for the secondary column to -1, it appears first in the flex-box item order

BUT..................

it appears second when the screen size is reduced?

I'm confused because he didn't use any media queries for this.

1 Answer

Ryan S
Ryan S
27,276 Points

Hi Kymane,

I don't quite understand what you mean about the media queries. All of the code in this video was written in the media queries.

The order of -1 was only given to the secondary column at a minimum width of 769px and above. So any width smaller than 769px will revert to it's original order (the way it appears in the html). You don't need to define this in a media query because it was all written using a mobile-first approach.

Hope this clears things up.

pat barosy
pat barosy
6,759 Points

Why was the order -1 placed in media query that targeted view screens of 769px and up? Why wasn't it placed in the second media query which displays all three lines?