我将我的应用程序定位于各种Android平板设备。主要是10英寸和7英寸的三星和Nexus。
为了瞄准三星Galaxy Tab 7英寸,使用了下面的媒体查询,1024x600像素。它在7英寸的Galaxy平板电脑2、3上运行得很好。但不适用于7英寸的Galaxy Tab 4。
@media only screen and (max-width: 1024px) and (orientation : landscape)
{ }三星Galaxy Tab 4.0 7英寸采用以下屏幕规格。这是相同的三星Galaxy 4.0 10.1英寸型号- SM-T530NYKAXAR。因此,在我的7英寸Galaxy Tab 4上,它使用了三星Galaxy tab 4.0 10英寸的媒体查询,并加载了奇怪的HTML页面。
如何通过媒体查询瞄准三星Galaxy Tab 4.0 7英寸。
屏幕规格:
物理尺寸:7英寸
分辨率: 1280x800 (横向)
像素密度: 216 ppi
谢谢。
发布于 2014-10-29 09:28:15
我已经创建了这个,并在设备上对其进行了测试,它似乎具有很高的针对性,并且工作正常。
@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;}
}https://stackoverflow.com/questions/25375313
复制相似问题