In the previous examples, we started
with layouts suitable for desktops.
Then we worked our way towards smaller
screen sizes by adding breakpoints to
change the styles for widths lower than
that of the breakpoint. This approach is
known as the Desktop First approach.
On the other hand, you can start with a
layout suitable for the mobile screens.
Usually, this would be a simpler design
choice:
First, resize the output panel to a
smaller width and then start increasing
the width. At 420px, let's introduce
a media query to stack col2
and
col3 next to each other.
Paste this in the editor provided above:
Then, for screen sizes larger
than 860px, let's change
the styles again by adding this:
This approach known as the Mobile First
approach is the recommended one.
Keep in mind that we used max-width
media feature for desktop-first
approach and min-width
for mobile-first approach.