Reputation: 1123
There was a related question to this in: Media Query for iPad (Landscape) applied to Samsung Galaxy Tab 2 (Landscape) as well
My question is what is the media query to get the Chrome browser on the Android Samsung Galaxy Tab 2 10.1 (Chrome Browser 18) to be detected as portrait mode.
I'm currently using:
@media all and (min-width: 479) and (max-width: 1199) and (max-device-width:1199px and (orientation: portrait)
But it doesn't work. It will work on the Android web browser but will not work once you flip it to landscape mode and then back to portrait mode. It will only work when you load page in portrait mode.
Upvotes: 0
Views: 5247
Reputation: 1
I have a solution to add i used the pixel ratio 1.5 to target.
Problem will be that there must be devices too, with similar dims, as the min device width is only 800px which covers many new android phones, but you'll be able to target its pixel ratio
* ++++++++++++++ 1280 mdpi portrait samsung tablets */
@media (min-device-width: 800px) and
(max-device-width: 1280px) and
(-webkit-min-device-pixel-ratio: 1.5){}
Upvotes: 0
Reputation: 46
This works for me on Samsung Galaxy Tab 10.1
@media only screen and (min-width: 800px) and (max-height: 1280px) and
(orientation : portrait){
/* Your code here */
}
@media only screen and (min-width: 1280px) and (max-height: 800px) and
(orientation : landscape){
/* Your code here */
}
Upvotes: 1
Reputation: 362
/* For Media Query for Tablets Ipads Portrait Mode */
@media (min-width:768px) and (max-width:1024px){
/*CSS HERE*/
}
Upvotes: 0
Reputation: 195
I had the same problem I found the actual resolution of the Galaxy Tab 2 10.1 to be 2560px x 1600px by using those px values I was able to pull the correct style sheet.
Upvotes: 0