Solved

Responsive design and Media Queries

Posted on 2013-01-22
2
545 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…
The viewer will learn how to dynamically set the form action using jQuery.

726 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