三星Galaxy S5媒体查询

5

我已经做了一些搜索并尝试了几种不同的方法,但是就我而言,我似乎无法专门针对三星Galaxy S5进行定位。我只是在网站上玩弄一些东西,但是我尝试的任何内容都似乎无法针对特定设备。

到目前为止,我尝试了以下方法:

@media only screen
(min-resolution: 144dpi)
and (device-width: 1920px)
and (orientation: landscape) {/*styles here*/}

@media screen
(-webkit-min-device-pixel-ratio: 1.5), 
(min-resolution: 144dpi)
and (device-width: 1920px)
and (orientation: landscape) {/*styles here*/}

@media only screen
    (device-width: 1920px)
    and (orientation: landscape) {/*styles here*/}

@media only screen
(min-device-width: 1080px)
and (max-device-width: 1920px)
and (orientation: landscape) {/*styles here*/}

注意:我只包含了与“landscape”相关的代码,但我已经尝试过没有那个和“portrait”的情况,但它仍然不起作用。任何帮助将不胜感激。

2
为了能够提供帮助,我需要知道您想要针对它的原因。您需要这个识别的期望结果是什么?或者说,需要解决的实际问题是什么?因为可能存在更简单的方法。 - Frank Conijn - Support Ukraine
1
如果您有S5,请浏览以下网址:http://pieroxy.net/blog/pages/css-media-queries/test-features.html - 这将为您提供特定的值,这些值可能会使您感到困惑。 - CaRDiaK
@FrankConijn - 我目前正在构建的网站有一个标题图像,我想要更换它以在每个设备上呈现出良好的效果。这并不是网站功能的必要部分,但它会为用户提供更好的体验。 - lardlad
@CaRDiaK - 感谢提供链接。我认为这会让我朝着正确的方向前进。 - lardlad
我在使用媒体查询时,遇到了几个S Galaxy型号无法渲染内容的问题。我不知道解决方案。 - posfan12
3个回答

6
@media screen and (device-width: 360px) and (device-height: 640px) and (-webkit-device-pixel-ratio: 3)

根据来源
希望能对您有所帮助。
祝好。

0

这对我有用...

/* Samsung Galaxy S5 Portrait */    
@media screen(-webkit-min-device-pixel-ratio: 2),(min-resolution: 192dpi)and (device-          width: 1440px)and (orientation: portrait){ 
/*Your styles here */
    html{
  display: none;
  }
}

0
尝试使用@media screen and (max-width: 680px) and (orientation:landscape),这对我很有帮助,我也有一台三星Galaxy S5。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接