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

Shaun Kelly
Shaun Kelly
33,515 Points

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