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 Two Column Layout with Flexbox

Mobile first approach

So in this flex-box series for mobile first approach were making media queries at the medium size screen, and the larger size screen width which makes sense. The confusing part to me is they never went over the 'mobile' styles, so how are we suppose to grasp how to style for mobile first if they never went over it? Am I missing something?

1 Answer

Hi Mathew,

a mobile first approach, takes the default styles (the styles outside of the media queries) and uses those on mobile. Your media queries will then allow you to manipulate your styles at certain breakpoints.

for example:

// Default styles used for mobile
div {
    display: block;
}

// Styles used for bigger breakpoints to manipulate the styles
@media (min-width: 1000px) {
    div {
        display: inline-block;
    }
}

Hope this helps, Shaun