Rag*_*agu 4 css media-queries hybrid-mobile-app
我的应用程序的目标是各种 Android 平板电脑设备。主要是10寸和7寸的三星和Nexus。
为了定位 Samsung Galaxy Tab 7 英寸,使用了以下媒体查询,1024x600 像素。它在 7 英寸的 Galaxy tab 2、3 上运行良好。但不适用于 Galaxy Tab 4 7 英寸。
@media only screen and (max-width: 1024px) and (orientation : landscape)
{ }
Run Code Online (Sandbox Code Playgroud)
三星 Galaxy Tab 4.0 7 英寸采用以下屏幕规格。三星 Galaxy 4.0 10.1 英寸型号 - SM-T530NYKAXAR 也是如此。因此,在我的 7 英寸 Galaxy Tab 4 上,它使用 Samsung Galaxy Tab 4.0 10 英寸的媒体查询并加载奇怪的 HTML 页面。
如何通过媒体查询定位 Samsung Galaxy Tab 4.0 7inch。
屏幕规格:
物理尺寸:7英寸
分辨率:1280x800(横向)
像素密度:216 ppi
谢谢。
我已经创建了这个并在设备上进行了测试,它似乎具有很强的针对性并且有效。
@media only screen
and (min-device-width: 800px)
and (max-device-height: 1280px)
and (min-resolution: 192dpi)
and (-webkit-device-pixel-ratio:2)
and (orientation : portrait)
{
.galaxy {background-color:red;}
.onlygalaxyportrait {display:block !important; background-color:green;}
}
@media only screen
and (min-device-width: 1280px)
and (max-device-height: 800px)
and (min-resolution: 192dpi)
and (-webkit-device-pixel-ratio:2)
and (orientation : landscape)
{
.galaxy {background-color:yellow;}
.onlygalaxyland {display:block !important; background-color:orange;}
}
Run Code Online (Sandbox Code Playgroud)