Solved

Responsive design and Media Queries

Posted on 2013-01-22
2
511 Views
Last Modified: 2013-01-24
I'm creating my first site using Responsive design.  I want to make sure I cover the most popular device sizes.  Please look at the following list and let me know if I should use different numbers, or if I should be aware of anything.

I'm looking for expert advice and comments.

@media screen and (max-width:320px) {}
@media screen and (min-width:321px) and (max-width:639px) {}
@media screen and (min-width:640px) and (max-width:959px) {}
@media screen and (min-width:960px) and (max-width:1279px) {}
@media screen and (min-width:1280px) and (max-width:1599px) {}
@media screen and (min-width:1600px) {}
@media screen and (min-width:1920px) {}
@media print {}

PS.. Do I need to place anything in the head so My CSS knows what the media screen width is?
0
Comment
Question by:rgranlund
2 Comments
 
LVL 25

Assisted Solution

by:Kyle Hamilton
Kyle Hamilton earned 250 total points
ID: 38808257
what you have is fine. you dont need anything in the head.

personally, i try to make my media queries device agnostic, and base them more on what my layout requires. that way you're not tied to any particular devices. but it's not that big a deal.
0
 
LVL 9

Accepted Solution

by:
darjimaulik earned 250 total points
ID: 38809717
Hi,
Your Media Query looks fine.

We generally create our responsive design in following way (Simple method)

In the same sequence.
Any Common Style should be placed before this query.

Advantage of this:
parameters which are changed for particular style should be placed in between.

@media screen and (max-width:980px)

@media screen and (max-width:700px)

@media screen and (max-width:480px)

Sample would be

@media screen and (max-width:700px)
{
    #content
    {
        width: auto;
        float: none;
    }
    #sidebar
    {
        width: auto;
        float: none;
    }
}

Open in new window

0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now