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 Framework Basics Build a Website with Bootstrap Adding Media Queries

Leigh Maher
Leigh Maher
21,830 Points

Shouldn't we be designing for mobile first?

It occurred to me when Guil introduces the media queries by using max-width, that he's building this site for desktop first and then adjusting for smaller viewports. Shouldn't we be designing for mobile first, and then use min-width media queries to adjust it for the larger viewports?

3 Answers

Ryan Field
PLUS
Ryan Field
Courses Plus Student 21,242 Points

It really depends on the situation. In general, building a site from a mobile-first approach is a good practice. Some sites, however, don't need a mobile version, in which case such an approach isn't needed. So, it's a good practice to be aware of, but it's not absolutely necessary depending on the situation.

When designing from a mobile-first approach, though, you're entirely correct that min-width media calls are better than max-width.

Leigh Maher
Leigh Maher
21,830 Points

Thanks Ryan. In this instance we are designing a responsive site (otherwise there would be no need for media queries).

Guil seems to promote the mobile first approach in his other courses. It would be interesting to find out why he approaches it differently here.

VISHAL DEEPAK
VISHAL DEEPAK
3,272 Points

This is only because we are using bootstrap.

Because bootstrap takes care of different devices once you have the right set-up