0

i have applied background color:gray for tablet, and blue color for my system browser with using of media queries css. It is working fine. Now the problem is, when i tured my system resolution to 1024x768, the tablet color - gray is applying to my system browser also instead of blue color. Please suggest me.

Below is my css:

.Box{background-color:#709bd3;height:200px}

@media screen and (min-device-width:600px) and (max-device-width:1024px) {
.Box{background-color:#ccc}
}
Pavan Kumar
  • 1,616
  • 5
  • 26
  • 38

1 Answers1

2

For a start, make sure you include a semicolon at the end of every statement.

.Box {
background-color:#709bd3;
height:200px;
}

@media only screen and (min-device-width:768px) and (max-device-width:1024px) {
    .Box {
    background-color:#ccc;
    }
}

I also changed min-device-width to 768px, which is the iPad's minimum.

EDIT - Looks as though you'll need to use the user agent string. Try following this:

http://www.htmlgoodies.com/beyond/webmaster/toolbox/article.php/3888106/How-Can-I-Detect-the-iPhone--iPads-User-Agent.htm

Jezen Thomas
  • 13,619
  • 6
  • 53
  • 91