Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are good resolution values to use with media queries?

Recently I've been playing around with CSS Media Queries because it's a great way to make my website adapt to various screen sizes. I am planning to implement them into the live version.

My question is: Are there any recommended resolution values at which the layout changes?

like image 397
Sven Avatar asked Jul 08 '12 16:07

Sven


People also ask

What media query sizes should I use?

In my experience, 320px, 768px, and 1200px are the most commonly used; these three values should be sufficient for targeting smart phones, tablets/laptops, and desktops, respectively.

Should I use max-width or min-width in media queries?

Generally if you are starting small screen first use min-width and then build on top with media queries targeting larger resolutions.


2 Answers

See this article for a template '320 and Up' - by Andy Clarke, it's used by many developers and designers: http://www.stuffandnonsense.co.uk/blog/about/this_is_the_new_320_and_up

If you scroll down to the media queries section you'll see they use five CSS3 Media Query increments (480, 600, 768, 992 and 1382px). Typically I stick to just 4 (480, 600, 768, 1024).

To explain the ranges:

min-width: 480px: Will target mobile devices in landscape mode and up

min-width: 600px: Targets tablets in portrait mode and up

min-width: 768px: Targets tablets in landscape mode and up

min-width: 1024px: Targets the desktop view

And typically I will have my mobile portrait view CSS at the very beginning (hence the term "320 and up").

like image 156
Suvi Vignarajah Avatar answered Nov 16 '22 04:11

Suvi Vignarajah


I would just like to add to Suvi's answer.

Adaptive Design applies media queries to targeted resolutions however with Responsive Design you are free to add the breakpoints wherever you feel is necessary.

There is no rule as to how many breakpoints a page should have, but one should be added wherever the layout breaks. The aim is to make sure the design and content flows nicely regardless of the width of the viewport.

I think this post provides a good overview:

http://www.williamwalker.me/blog/an-introduction-to-responsive-design.html

like image 26
williamium Avatar answered Nov 16 '22 04:11

williamium