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

Media queries, mobile first

Hi All,

Ive trying to understand, and get into the habit of creating mobile first sites.

However, I have millions of media queries! Is there a set guide for this?

For example mobiles = ,tablets = etc. Obviously they both differ with every model.

Thanks Lee

2 Answers

If you use Bootstrap, their guidlines are here: http://getbootstrap.com/css/ , scroll down to Media Queries.

Extra small devices Phones (<768px), Small devices Tablets (≥768px), Medium devices Desktops (≥992px), Large devices Desktops (≥1200px)

So you would create a query for tablets like this:

@media (min-width: @screen-sm-min) { ... }

Since 'sm' in bootstrap means Small devices (tablets, 768px and up). Check out that link for all the information. Of course, for all this to work you have to include Bootstrap in your project first.

Thanks for your help