Solved

Having problem with CSS media queries not targeting specifc devices

Posted on 2012-03-22
2
440 Views
Last Modified: 2012-04-08
I am having trouble with the CSS media queries.  The following css code isn't working to target specific devices.  I am stuck as to what I am doing wrong or what I am missing in the code.

/*Target IPAD In Portrait Mode */
@media (max-device-width: 1024px) and (orientation:portrait)
{
    
}

/*Target IPAD In Landscape Mode */
@media (max-device-width: 1024px) and (orientation:landscape)
{
    
}




/*Target Playbook In Portrait Mode */
@media (max-width:480px) and (max-height:1024px)  and (orientation:portrait)
{
   
}

/*Target Playbook In landscape Mode */
@media (min-width:480px) and (max-width:1024px)  and (orientation:landscape)
{
  
}



/* Large screens Samsung Galaxy ----------- */
@media (max-device-width : 1280px)  and (orientation:landscape)  {
   
}

@media (max-device-width : 800px)  and (orientation:portrait) {
  
}

Open in new window

0
Comment
Question by:stargateatlantis
2 Comments
 
LVL 30

Expert Comment

by:LZ1
ID: 37753061
There are no declarations inside the queries. You have to put something inside of the @media selectors:

@media (max-device-width: 1024px) and (orientation:portrait)
{
 #wrapper{width:600px;}   
}

Open in new window

0
 
LVL 16

Accepted Solution

by:
s8web earned 500 total points
ID: 37760573
Did you remove the declarations inside the queries for brevity? If so:

Is it not working in all browsers, or just some?

Can you provide a link to a working page? If not, we're probably going to need to see more of your markup to help.

You might try being more specific in your query, for example:

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

}

Open in new window

0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Responsive CSS question 2 42
Video on my site 4 28
Urgent need help ASAP With CSS 5 21
contractual requirements for app hosting 3 26
This article discusses four methods for overlaying images in a container on a web page
Any business that wants to seriously grow needs to keep the needs and desires of an international audience of their websites in mind. Making a website friendly to international users isn’t prohibitively expensive and can provide an incredible return…
In this tutorial viewers will learn how to customize the background color and font color of highlighted text using the ::selection element in CSS Begin by defining the selected text as an element in CSS by typing "::selection": Style the ::selection…
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…

760 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

26 Experts available now in Live!

Get 1:1 Help Now