Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Responsive design and Media Queries

Posted on 2013-01-22
2
Medium Priority
?
561 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 1000 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 1000 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

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.
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.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
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 …

715 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